Skip to main content

Module reader

Module reader 

Source
Expand description

Reading audio files.

Two decoders share the work: the wav fast path right here in this module, and general, the Symphonia-backed path for every other format, which only exists when the symphonia feature is on. decode is where the two meet - it tries the wav path first and only reaches for general when that declines the file.

§Channel count limits

Symphonia maps channels to named speaker positions rather than treating them as a plain count, so formats read through it have channel ceilings below what the format itself allows. Wav files read by the built-in decoder have no ceiling, and neither does Matroska, so prefer Matroska for high channel counts in a compressed format.

  • WAV files the built-in decoder cannot handle, so ADPCM and A-law/mu-law, are rejected above 18 channels for an extensible fmt chunk, or 26 for a plain one.
  • CAF is unreliable above 18 channels: a 24-channel file decodes as 18 channels with misaligned samples and no error at all, and 32 channels is rejected.
  • FLAC is capped at 8 channels by the format itself.

Structs§

Audio
Audio data with interleaved samples
ReadConfig

Enums§

Position
Position in the audio stream (for start or stop points)
ReadError

Traits§

ResampleSample
What read needs of a sample type beyond being a float, which is whatever the resampler needs of it. With the resample feature that is rubato::Sample. The trait governing a single sample.

Functions§

read
Read an audio file from disk.