Overview
Symphonia provides a pure Rust implementation of the Vorbis audio decoder. Vorbis is a free, open-source lossy audio compression format that offers excellent quality-to-bitrate ratio and is commonly used in OGG containers.Feature Flag
To enable Vorbis support, add thevorbis feature to your Cargo.toml:
Status
Status: Excellent- Decoding: Fully supported
- Gapless Playback: Yes
- Container Support: OGG (requires
oggfeature), WebM/Matroska (requiresmkvfeature)
Codec Type
Decoder
The Vorbis decoder is implemented by theVorbisDecoder struct:
Container Requirements
Vorbis requires a container format. It cannot be used as a standalone codec:Supported Features
Vorbis Version
- Vorbis I specification compliant
Bitrates
- Variable Bitrate (VBR): 45-500 kbps (typical)
- Quality-based encoding (q-1 to q10)
- Managed bitrate encoding
Sample Rates
Supports all sample rates from 8 kHz to 192 kHz, including:- 8 kHz, 11.025 kHz, 12 kHz
- 16 kHz, 22.05 kHz, 24 kHz
- 32 kHz, 44.1 kHz, 48 kHz
- 88.2 kHz, 96 kHz
- 176.4 kHz, 192 kHz
Channels
Up to 255 channels (theoretically), with standard mappings for:- Mono (1.0)
- Stereo (2.0)
- 3.0 (L, C, R)
- Quad (L, R, Ls, Rs)
- 5.0 (L, C, R, Ls, Rs)
- 5.1 (L, C, R, Ls, Rs, LFE)
- 6.1 (L, C, R, Ls, Rs, Cs, LFE)
- 7.1 (L, C, R, Ls, Rs, Lb, Rb, LFE)
Decoding Features
- Variable block size windowing
- MDCT (Modified Discrete Cosine Transform)
- Residue vector quantization
- Floor synthesis (Floor0 and Floor1)
- Channel coupling
- Huffman-style codebooks
Channel Mapping
Vorbis uses a specific channel ordering that Symphonia automatically handles:Metadata Support
Vorbis uses Vorbis Comments for metadata:Usage Example
Sample Format
Vorbis decodes to 32-bit floating-point samples (f32):Performance
- Pure Rust implementation with no unsafe code
- Efficient MDCT using optimized algorithms
- Minimal memory allocations during decoding
- Streaming-friendly design
Limitations
- Must be used with a container format (OGG, WebM/Matroska)
- Does not support encoding (decode-only)
- Maximum of 255 channels (Vorbis specification limit)
- Maximum of 32 channels practically supported by Symphonia
Specification Compliance
Fully compliant with:- Vorbis I specification
- RFC 7845 (Ogg encapsulation of Vorbis)