Skip to main content
Symphonia is a 100% pure Rust audio decoding and multimedia format demuxing framework. It provides high-performance, safe, and reliable audio processing capabilities for Rust applications.

What is Symphonia?

Symphonia is a pure Rust audio decoding and media demuxing library that supports a wide variety of audio codecs and container formats including AAC, ADPCM, AIFF, ALAC, CAF, FLAC, MKV, MP1, MP2, MP3, MP4, OGG, Vorbis, WAV, and WebM. The library creates a clear separation between demuxing (reading container formats) and decoding (converting codec bitstreams to audio samples), allowing you to mix and match different formats and codecs as needed.

Key Features

Pure Rust

100% safe Rust with no unsafe code, providing memory safety and security guarantees.

High Performance

Performance comparable to or faster than popular C-based implementations like FFmpeg (+/-15%).

Wide Format Support

Decode support for the most popular audio codecs with automatic format and decoder detection.

Gapless Playback

Support for gapless playback on compatible formats and codecs.

Minimal Dependencies

Lean dependency tree with optional features to keep your builds small.

Rich Metadata

Read most metadata and tagging formats including ID3v1, ID3v2, Vorbis comments, and more.

Supported Formats

By default, Symphonia only enables support for royalty-free open standard codecs and formats. Additional formats can be enabled using feature flags.

Container Formats (Demuxers)

FormatStatusGaplessDefault
AIFFGreatYesNo
CAFGoodNoNo
ISO/MP4GreatNoNo
MKV/WebMGoodNoYes
OGGGreatYesYes
WaveExcellentYesYes

Audio Codecs (Decoders)

CodecStatusGaplessDefault
AAC-LCGreatNoNo
ADPCMGoodYesYes
ALACGreatYesNo
FLACExcellentYesYes
MP1GreatNoNo
MP2GreatNoNo
MP3ExcellentYesNo
PCMExcellentYesYes
VorbisExcellentYesYes
Gapless playback requires support from both the demuxer and decoder.

When to Use Symphonia

Symphonia is ideal for:
  • Audio Players: Build music players, podcast players, or any application that needs to decode and play audio files
  • Audio Processing: Implement audio analysis, transcoding, or conversion tools
  • Game Development: Integrate audio decoding into game engines
  • Embedded Systems: Leverage Rust’s safety guarantees for embedded audio applications
  • Cross-Platform Applications: Build once and deploy to multiple platforms with consistent behavior

Architecture Overview

Symphonia’s architecture separates concerns into distinct components:
  1. Media Source: Provides the raw data stream (files, network streams, etc.)
  2. Format Reader (Demuxer): Reads container formats and extracts codec packets
  3. Decoder: Converts codec packets into raw audio samples
  4. Sample Buffers: Provide convenient access to decoded audio data

Quality and Safety

Symphonia prioritizes:
  • Correctness: Decode media as correctly as leading free-and-open-source decoders
  • Security: Prevent denial-of-service attacks through robust error handling
  • Testing: Comprehensive fuzz testing to ensure stability
  • API Design: Powerful, consistent, and easy-to-use APIs

Get Started

Installation

Add Symphonia to your Rust project and configure feature flags

Quick Start

Build your first audio decoder in minutes

API Reference

Explore the complete API documentation

Examples

View working code examples on GitHub

Community and Support

Symphonia is an open-source project licensed under the MPL v2.0. Contributions are welcome!

Minimum Rust Version

Symphonia requires Rust 1.53.0 or later.

Build docs developers (and LLMs) love