Skip to main content

decode_pcm_as_float

Function decode_pcm_as_float 

Source
pub fn decode_pcm_as_float(wav: &Wav) -> Result<Vec<f32>, PcmError>
Expand description

Decodes the audio data into a vector of normalized f32 samples.

Samples are interleaved (e.g., L, R, L, R for stereo). Normalized samples are in the range [-1.0, 1.0].

ยงErrors

PcmError::UnsupportedEncoding when the fmt chunk does not declare plain PCM, PcmError::UnsupportedBitDepth for a width this decoder has no conversion for, and PcmError::MisalignedData when the data length is not a whole number of samples.