Home

Awesome

<div align="center"> <h1>Symphonia</h1> <!-- <p> <img src="https://raw.githubusercontent.com/pdeljanov/symphonia/master/assets/logo.png" width="200px" /> </p> --> <p> <a href="https://crates.io/crates/symphonia"> <img alt="Crate Info" src="https://img.shields.io/crates/v/symphonia.svg"/> </a> <a href="https://docs.rs/symphonia/"> <img alt="API Docs" src="https://img.shields.io/badge/docs.rs-symphonia-brightgreen"/> </a> <a href="https://github.com/pdeljanov/Symphonia/actions/workflows/ci.yml"> <img src="https://github.com/pdeljanov/Symphonia/actions/workflows/ci.yml/badge.svg" /> </a> <a href="https://deps.rs/repo/github/pdeljanov/symphonia"> <img src="https://deps.rs/repo/github/pdeljanov/symphonia/status.svg" /> </a> <a href="https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html"> <img alt="Rustc Version 1.53.0+" src="https://img.shields.io/badge/rustc-1.53%2B-lightgrey.svg"/> </a> </p> <p> <strong> Symphonia is a pure Rust audio decoding and media demuxing library supporting AAC, ADPCM, AIFF, ALAC, CAF, FLAC, MKV, MP1, MP2, MP3, MP4, OGG, Vorbis, WAV, and WebM. </strong> </p> <p> <h3> <a href="https://github.com/pdeljanov/Symphonia/blob/master/GETTING_STARTED.md">Getting Started</a> <span> · </span> <a href="https://docs.rs/symphonia">Documentation</a> <span> · </span> <a href="https://github.com/pdeljanov/Symphonia/tree/master/symphonia/examples">Examples</a> <span> · </span> <a href="https://github.com/pdeljanov/Symphonia/blob/master/BENCHMARKS.md">Benchmarks</a> </h3> </p> </div>

Features

Additionally, planned features include:

Roadmap

Support for individual audio codecs and media formats are provided by separate crates. By default, Symphonia only enables support royalty-free open standard codecs and formats, but others may be enabled using feature flags.

Tip: All formats and codecs can be enabled with the all feature flag.

Status

The following status classifications are used to determine the state of development for each format or codec.

StatusMeaning
-In work or not started yet.
GoodMany media streams play. Some streams may panic, error, or produce audible glitches. Some features may not be supported.
GreatMost media streams play. Inaudible glitches may be present. Most common features are supported.
ExcellentAll media streams play. No audible or inaudible glitches. All required features are supported.

A status of Great indicates that major development is complete and that the feature is in a state that would be acceptable for most applications to use.

A status of Excellent is only assigned after the feature passes all compliance tests. If no compliance tests are readily available, then a status of Excellent will be assigned if Symphonia's output matches that of a reference implementation, or ffmpeg, over a large test corpus.

Formats (Demuxers)

FormatStatusGapless*Feature FlagDefaultCrate
AIFFGreatYesaiffNosymphonia-format-riff
CAFGoodNocafNosymphonia-format-caf
ISO/MP4GreatNoisomp4Nosymphonia-format-isomp4
MKV/WebMGoodNomkvYessymphonia-format-mkv
OGGGreatYesoggYessymphonia-format-ogg
WaveExcellentYeswavYessymphonia-format-riff

* Gapless playback requires support from both the demuxer and decoder.

Tip: All formats can be enabled with the all-formats feature flag.

Codecs (Decoders)

CodecStatusGaplessFeature FlagDefaultCrate
AAC-LCGreatNoaacNosymphonia-codec-aac
ADPCMGoodYesadpcmYessymphonia-codec-adpcm
ALACGreatYesalacNosymphonia-codec-alac
HE-AAC (AAC+, aacPlus)--he-aacNosymphonia-codec-aac
HE-AACv2 (eAAC+, aacPlus v2)--he-aac-v2Nosymphonia-codec-aac
FLACExcellentYesflacYessymphonia-bundle-flac
MP1GreatNomp1, mpaNosymphonia-bundle-mp3
MP2GreatNomp2, mpaNosymphonia-bundle-mp3
MP3ExcellentYesmp3, mpaNosymphonia-bundle-mp3
Opus--opusYessymphonia-codec-opus
PCMExcellentYespcmYessymphonia-codec-pcm
VorbisExcellentYesvorbisYessymphonia-codec-vorbis
WavPack--wavpackYessymphonia-codec-wavpack

A symphonia-bundle-* package is a combination of a decoder and a native demuxer.

Tip: All codecs can be enabled with the all-codecs feature flag. Similarly, all MPEG audio codecs can be enabled with the mpa feature flag.

Tags (Readers)

All metadata readers are provided by the symphonia-metadata crate.

FormatStatus
ID3v1Great
ID3v2Great
ISO/MP4Great
RIFFGreat
Vorbis comment (FLAC)Perfect
Vorbis comment (OGG)Perfect

Quality

In addition to the safety guarantees afforded by Rust, Symphonia aims to:

Performance

Symphonia aims to be comparable to, or faster than, popular open-source C-based implementations. Currently, Symphonia's decoders are generally +/-15% the performance of FFMpeg. However, the exact range will depend strongly on the codec, which features of the codec are being leveraged in the encoding, the Rust compiler version, and the CPU architecture being compiled for.

See the benchmarks for more information.

Optimizations

At this time, SIMD optimizations are not enabled by default. Enabling any SIMD support feature flags will pull in the rustfft dependency.

Instruction SetFeature FlagDefault
SSEopt-simd-sseNo
AVXopt-simd-avxNo
Neonopt-simd-neonNo

Tip: All SIMD optimizations can be enabled with the opt-simd feature flag.

Examples

Basic usage examples may be found here.

For a more complete application, see symphonia-play, a simple music player.

Tools

Symphonia provides the following tools for debugging purposes:

Author

The primary author is Philip Deljanov.

Special Thanks

License

Symphonia is provided under the MPL v2.0 license. Please refer to the LICENSE file for more details.

Contributing

Symphonia is a free and open-source project that welcomes contributions! To get started, please read our Contribution Guidelines.