Basic Installation
Add Symphonia to yourCargo.toml:
By default, Symphonia only enables support for royalty-free open standard formats and codecs (OGG, MKV/WebM, Wave, ADPCM, FLAC, PCM, Vorbis).
Feature Flags
Symphonia uses feature flags to enable specific codecs and formats. This keeps your build lean by only including what you need.Convenience Features
These features enable multiple codecs or formats at once:| Feature Flag | Description | Includes |
|---|---|---|
all | Enable all supported codecs and formats | all-codecs + all-formats |
all-codecs | Enable all supported audio codecs | aac, adpcm, alac, flac, mp1, mp2, mp3, pcm, vorbis |
all-formats | Enable all supported container formats | caf, isomp4, mkv, ogg, aiff, wav |
mpa | Enable all MPEG audio codecs | mp1, mp2, mp3 |
Codec Features
Individual codec support:| Feature Flag | Codec | Status | Default | Gapless |
|---|---|---|---|---|
aac | AAC-LC | Great | No | No |
adpcm | ADPCM | Good | Yes | Yes |
alac | Apple Lossless (ALAC) | Great | No | Yes |
flac | FLAC | Excellent | Yes | Yes |
mp1 | MPEG-1 Audio Layer I | Great | No | No |
mp2 | MPEG-1 Audio Layer II | Great | No | No |
mp3 | MPEG-1 Audio Layer III | Excellent | No | Yes |
pcm | PCM (uncompressed) | Excellent | Yes | Yes |
vorbis | Vorbis | Excellent | Yes | Yes |
Format Features
Individual container format support:| Feature Flag | Format | Status | Default | Gapless |
|---|---|---|---|---|
aiff | Audio Interchange File Format | Great | No | Yes |
caf | Core Audio Format | Good | No | No |
isomp4 | ISO/MP4, M4A, M4V | Great | No | No |
mkv | Matroska, WebM | Good | Yes | No |
ogg | OGG | Great | Yes | Yes |
wav | WAVE | Excellent | Yes | Yes |
Optimization Features
SIMD optimizations are not enabled by default:| Feature Flag | Description | Default |
|---|---|---|
opt-simd | Enable all SIMD optimizations | No |
opt-simd-sse | Enable SSE optimizations | No |
opt-simd-avx | Enable AVX optimizations | No |
opt-simd-neon | Enable Neon optimizations (ARM) | No |
Common Configuration Examples
MP3 Player
For a simple MP3 player:Cargo.toml
Universal Audio Player
For an application that supports most common audio formats:Cargo.toml
Video File Audio Extraction
For extracting audio from video containers:Cargo.toml
High-Performance Audio Processing
With SIMD optimizations enabled:Cargo.toml
Minimal Build (Custom Features)
For embedded or size-constrained applications:Cargo.toml
Requirements
- Rust Version: 1.53.0 or later
- Dependencies: Minimal - Symphonia has very few dependencies by default
- Platform: Cross-platform (Linux, macOS, Windows, and more)
Verifying Installation
After adding Symphonia to yourCargo.toml, verify it’s working by building your project:
Terminal
Terminal
Next Steps
Quick Start Guide
Build your first audio decoder with Symphonia
API Documentation
Explore the complete API reference