Skip to main content
Symphonia is distributed as a Rust crate and can be added to your project using Cargo.

Basic Installation

Add Symphonia to your Cargo.toml:
[dependencies]
symphonia = "0.5"
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 FlagDescriptionIncludes
allEnable all supported codecs and formatsall-codecs + all-formats
all-codecsEnable all supported audio codecsaac, adpcm, alac, flac, mp1, mp2, mp3, pcm, vorbis
all-formatsEnable all supported container formatscaf, isomp4, mkv, ogg, aiff, wav
mpaEnable all MPEG audio codecsmp1, mp2, mp3

Codec Features

Individual codec support:
Feature FlagCodecStatusDefaultGapless
aacAAC-LCGreatNoNo
adpcmADPCMGoodYesYes
alacApple Lossless (ALAC)GreatNoYes
flacFLACExcellentYesYes
mp1MPEG-1 Audio Layer IGreatNoNo
mp2MPEG-1 Audio Layer IIGreatNoNo
mp3MPEG-1 Audio Layer IIIExcellentNoYes
pcmPCM (uncompressed)ExcellentYesYes
vorbisVorbisExcellentYesYes

Format Features

Individual container format support:
Feature FlagFormatStatusDefaultGapless
aiffAudio Interchange File FormatGreatNoYes
cafCore Audio FormatGoodNoNo
isomp4ISO/MP4, M4A, M4VGreatNoNo
mkvMatroska, WebMGoodYesNo
oggOGGGreatYesYes
wavWAVEExcellentYesYes

Optimization Features

SIMD optimizations are not enabled by default:
Feature FlagDescriptionDefault
opt-simdEnable all SIMD optimizationsNo
opt-simd-sseEnable SSE optimizationsNo
opt-simd-avxEnable AVX optimizationsNo
opt-simd-neonEnable Neon optimizations (ARM)No
Enabling any SIMD support feature will add the rustfft dependency to your project.

Common Configuration Examples

MP3 Player

For a simple MP3 player:
Cargo.toml
[dependencies]
symphonia = { version = "0.5", features = ["mp3"] }

Universal Audio Player

For an application that supports most common audio formats:
Cargo.toml
[dependencies]
symphonia = { version = "0.5", features = [
    "aac",      # AAC/M4A files
    "alac",     # Apple Lossless
    "flac",     # FLAC
    "isomp4",   # MP4/M4A container
    "mp3",      # MP3
    "vorbis",   # OGG Vorbis
    "wav",      # WAV (already default)
] }

Video File Audio Extraction

For extracting audio from video containers:
Cargo.toml
[dependencies]
symphonia = { version = "0.5", features = [
    "isomp4",   # MP4/M4V files
    "mkv",      # MKV/WebM files
    "aac",      # AAC codec
    "mp3",      # MP3 codec
    "vorbis",   # Vorbis codec
] }

High-Performance Audio Processing

With SIMD optimizations enabled:
Cargo.toml
[dependencies]
symphonia = { version = "0.5", features = [
    "all",
    "opt-simd",  # Enable all SIMD optimizations
] }

Minimal Build (Custom Features)

For embedded or size-constrained applications:
Cargo.toml
[dependencies]
symphonia = { 
    version = "0.5", 
    default-features = false,
    features = ["wav", "pcm"]  # Only WAV + PCM support
}

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 your Cargo.toml, verify it’s working by building your project:
Terminal
cargo build
You can also check which features are enabled:
Terminal
cargo tree -e features | grep symphonia

Next Steps

Quick Start Guide

Build your first audio decoder with Symphonia

API Documentation

Explore the complete API reference

Build docs developers (and LLMs) love