Skip to main content

Module format

Module format 

Source
Expand description

Audio format detection and metadata extraction for the audio pipeline.

This module provides fast, robust format detection using a hybrid approach:

  • Fast path: Magic-byte detection for common formats (WAV, FLAC, MP3) - <1µs
  • Validation path: Symphonia probe for complex formats (Opus, WebM, M4A) - <10ms

§Performance Contract

  • Detection latency: <1ms for 99% of inputs
  • Total processing: <10ms including validation
  • Zero panics: All byte access bounds-checked

§Supported Formats

  • WAV (RIFF/PCM): Primary format, instant detection
  • FLAC: Lossless compression, instant detection
  • MP3: MPEG-1/2 Layer 3, frame sync validation
  • Opus: Ogg container with Opus codec
  • WebM: Matroska container (audio track)
  • M4A/AAC: MPEG-4 container with AAC codec

Structs§

AudioMetadata
Audio metadata extracted during format detection.
FormatDetector
Audio format detector using hybrid magic-byte + Symphonia validation.

Enums§

AudioFormat
Audio container and codec format identifier.