Symphonia
A 100% safe, pure-Rust audio decoding and media demuxing library supporting MP3, FLAC, AAC, ALAC, Vorbis, Opus, WAV, and more.
Repository Health
Technical Analysis
Symphonia is a pure-Rust library for demuxing media containers, reading tags/metadata, and decoding audio codecs — an alternative to wrapping FFmpeg or libavcodec via FFI. It’s organized as a Cargo workspace of many small crates (symphonia-core, symphonia-codec-*, symphonia-format-*, symphonia-metadata), all re-exported through the umbrella symphonia crate with feature flags gating which codecs and containers get compiled in. Because everything is written in safe Rust with no unsafe FFI boundary to a C decoder, it eliminates a whole class of memory-safety bugs that historically plague media-parsing code — a meaningful advantage for any application that decodes untrusted audio files.
What You Get
- Automatic format and codec probing/detection — point it at a byte stream and it identifies the container and codec without manual configuration
- Decoders for AAC-LC, ADPCM, ALAC, FLAC, MP1/MP2/MP3, Opus, PCM, Vorbis, and WavPack, each gated behind an opt-in Cargo feature flag
- Demuxers for AIFF, CAF, ISO/MP4, MKV/WebM, OGG, and WAV container formats
- Metadata/tag readers for APEv1/v2, ID3v1/ID3v2, and Vorbis comments via the
symphonia-metadatacrate - Gapless playback support for formats/codecs where the demuxer and decoder both support it (FLAC, ALAC, MP3, Vorbis, PCM, ADPCM)
Common Use Cases
- Building a music player or audio engine in Rust without linking against FFmpeg or other C decoding libraries
- Decoding untrusted user-uploaded audio files where memory safety against malformed input is a security requirement
- Extracting metadata/tags (artist, album, cover art) from audio files across multiple container and tag formats
- Cross-platform audio applications (including WASM targets) that need a single dependency-light decoding stack instead of platform-specific codec libraries
Under The Hood
Architecture - Symphonia is structured as a Cargo workspace: symphonia-core defines shared traits (Decoder, FormatReader, Packet, AudioBuffer) and the probing/registry system that maps magic bytes to the right demuxer, while each codec and container format lives in its own crate (symphonia-codec-aac, symphonia-format-mkv, symphonia-bundle-mp3, etc.) implementing those core traits; the umbrella symphonia crate re-exports everything and uses Cargo feature flags to let consumers compile in only the formats/codecs they need. Bundle crates like symphonia-bundle-mp3 combine a demuxer and decoder for formats where the container and codec are tightly coupled. Tech Stack - Pure Rust (99.9% of the codebase) targeting Rust 1.85+ as MSRV, with SIMD optimizations (SSE, AVX, Neon) enabled by default via the opt-simd feature and the rustfft crate pulled in for those code paths; the project deliberately keeps dependencies minimal and has zero unsafe FFI to C decoding libraries. Code Quality - The project uses symphonia-check (a dedicated validation crate) to compare decoded output against reference implementations and FFmpeg over a large test corpus, plus a documented per-format/per-codec status classification (Good/Great/Excellent) that tracks exactly how compliant each decoder is — a level of transparency about correctness that’s uncommon in media libraries; CI runs via GitHub Actions and clippy.toml/rustfmt.toml enforce consistent style across the workspace. API Design - A single call to probe a byte stream returns a FormatReader, from which packets are pulled and handed to a Decoder to yield AudioBuffers — a consistent, low-boilerplate flow across every supported format; the tradeoff is that consumers must opt into feature flags per codec/format they need, which adds a small upfront decision compared to an all-in-one library, but keeps binary size down.
Used by 4 apps in this directory
Epicenter
Knowledge Management · Note Taking · Developer Tools
A local-first monorepo led by Whispering, an open-source speech-to-text app, built on an MIT toolkit that turns your data into plain Markdown and SQLite files you own instead of a database you rent.
Fyrox
Game Development
A production-ready 2D/3D game engine written in Rust with a built-in scene editor, physics, and hot-reloading game scripts
Meetily
Productivity · AI Assistants
Privacy-first AI meeting assistant that transcribes and summarizes your meetings entirely on your local machine — no cloud, no data leakage.
Voicebox
AI Development · Productivity
Clone voices, dictate anywhere, and give AI agents your voice — all locally.