Expand description
FLAC audio decoder.
Decodes FLAC frames back into interleaved i32 PCM samples.
§Decoding pipeline
- Parse FLAC stream header (
fLaC+ STREAMINFO). - Parse frame header (sync code, block size, channel count, etc.).
- Decode each subframe:
- LPC subframe: read warmup samples, quantised coefficients, Rice residuals,
then call
restore_signalto reconstruct the channel. - Verbatim subframe: read raw 16-bit samples directly.
- LPC subframe: read warmup samples, quantised coefficients, Rice residuals,
then call
- Interleave channels to produce the output PCM block.
- Verify frame CRC-16.
Structs§
- Decoded
Block - A decoded PCM block.
- Flac
Decoder - FLAC audio decoder.
- Flac
Stream Info - Information extracted from the FLAC stream header (STREAMINFO metadata block).
- Flac
Vorbis Comment - Vendor and user comments extracted from a VORBIS_COMMENT metadata block.