pub fn encode(
samples: &[f32],
sample_rate: u32,
channels: u8,
bit_depth: u8,
metadata: Option<Vec<u8>>,
) -> Result<Vec<u8>, JsValue>Expand description
encode samples to flo lossless
§Arguments
samples- Interleaved audio samples (f32, -1.0 to 1.0)sample_rate- Sample rate in Hz (e.g., 44100)channels- Number of channels (1 or 2)bit_depth- Bits per sample (16, 24, or 32)metadata- Optional MessagePack metadata
§Returns
flo™ file as byte array
§Note
For advanced usage with custom compression levels (0-9),
use the Encoder builder pattern directly.