pub fn encode_with_bitrate(
samples: &[f32],
sample_rate: u32,
channels: u8,
_bit_depth: u8,
target_bitrate_kbps: u32,
metadata: Option<Vec<u8>>,
) -> Result<Vec<u8>, JsValue>Expand description
encode to flo lossy with target bitrate
§Arguments
samples- Interleaved audio samples (f32, -1.0 to 1.0)sample_rate- Sample rate in Hz (e.g., 44100)channels- Number of audio channelsbit_depth- Bits per sample (16, 24, or 32)target_bitrate_kbps- Target bitrate in kbps (e.g., 128, 192, 256, 320)metadata- Optional MessagePack metadata
§Returns
flo™ file as byte array