pub fn encode_lossy(
samples: &[f32],
sample_rate: u32,
channels: u8,
_bit_depth: u8,
quality: u8,
metadata: Option<Vec<u8>>,
) -> Result<Vec<u8>, JsValue>Expand description
encode samples to flo lossy
§Arguments
samples- Interleaved audio samples (f32, -1.0 to 1.0)sample_rate- Sample rate in Hz (e.g., 44100)channels- Number of audio channels (1 or 2)bit_depth- Bits per sample (typically 16)quality- Quality level 0-4 (0=low/~64kbps, 4=transparent/~320kbps)metadata- Optional MessagePack metadata
§Returns
flo™ file as byte array
§Note
For advanced usage with continuous quality control (0.0-1.0) or custom settings,
use the LossyEncoder builder pattern directly.