Skip to main content

Module decoder

Module decoder 

Source
Expand description

FLAC audio decoder.

Decodes FLAC frames back into interleaved i32 PCM samples.

§Decoding pipeline

  1. Parse FLAC stream header (fLaC + STREAMINFO).
  2. Parse frame header (sync code, block size, channel count, etc.).
  3. Decode each subframe:
    • LPC subframe: read warmup samples, quantised coefficients, Rice residuals, then call restore_signal to reconstruct the channel.
    • Verbatim subframe: read raw 16-bit samples directly.
  4. Interleave channels to produce the output PCM block.
  5. Verify frame CRC-16.

Structs§

DecodedBlock
A decoded PCM block.
FlacDecoder
FLAC audio decoder.
FlacStreamInfo
Information extracted from the FLAC stream header (STREAMINFO metadata block).
FlacVorbisComment
Vendor and user comments extracted from a VORBIS_COMMENT metadata block.