Skip to main content

encode_audio_to_file

Function encode_audio_to_file 

Source
pub fn encode_audio_to_file(
    path: &Path,
    samples: &[f32],
    channels: usize,
    sample_rate: u32,
    format: AudioEncodeFormat,
    dither: AudioDither,
) -> Result<()>
Expand description

Encode interleaved f32 samples to a file using OxideAV.

samples must be interleaved (ch0 ch1 ... chN ...). channels is clamped to at least 1. sample_rate must be non-zero. Integer formats are quantised from the [-1.0, 1.0] float range; for WAV and FLAC the requested bit depth is honoured, while MP3 always uses 16-bit PCM internally.