Skip to main content

Crate symphonia

Crate symphonia 

Source
Expand description

§Project Symphonia

Symphonia is a 100% pure Rust audio decoding and multimedia format demuxing framework.

§Support

Supported formats, codecs, and metadata tags are listed below. By default Symphonia only enables royalty-free open standard media formats and codecs. Other formats and codecs must be enabled using feature flags.

Tip: All format, codec, and metadata support can be enabled with the all feature flag.

§Formats

The following container formats are supported.

FormatFeature FlagGapless*Default
AIFFaiffYesNo
CAFcafNoNo
ISO/MP4isomp4NoNo
MKV/WebMmkvNoYes
OGGoggYesYes
WavewavYesYes

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

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

§Codecs

The following codecs are supported.

CodecFeature FlagGaplessDefault
AAC-LCaacNoNo
ADPCMadpcmYesYes
ALACalacYesNo
FLACflacYesYes
MP1mp1, mpaNoNo
MP2mp2, mpaNoNo
MP3mp3, mpaYesNo
PCMpcmYesYes
VorbisvorbisYesYes

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.

§Metadata

For metadata formats that are standalone and not part of the media container, a feature flag may be used to toggle support.

FormatFeature FlagDefault
APEv1apeYes
APEv2apeYes
ID3v1id3v1Yes
ID3v2id3v2Yes
ISO/MP4N/AN/A
RIFFN/AN/A
Vorbis comment (FLAC)N/AN/A
Vorbis comment (OGG)N/AN/A

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

§Optimizations

SIMD optimizations are enabled by default. Precise control over which SIMD instruction sets are supported may be controlled using the following feature flags. Enabling any SIMD support feature flag will pull in the rustfft dependency.

Instruction SetFeature FlagDefault
SSEopt-simd-sseYes
AVXopt-simd-avxYes
Neonopt-simd-neonYes

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

§Experimental Features

Previews of experimental new features may be enabled by using feature flags. Experimental features should be used for development purposes only. Before using an experimental feature, please observe the warnings below. Never use experimental features in a production application.

Experimental FeatureFeature Flag
Subtitle codec supportexp-subtitle-codecs
Video codec supportexp-video-codecs

§Warnings

  • SemVer compatibilty is not guaranteed. Be prepared for build failures.
  • Experimental features and their associated feature flags may be removed at any time.
  • Functionality may change or break at any time.
  • Again, never use in any production application.

§Usage

An example implementation of a simple audio player (symphonia-play) can be found in the Project Symphonia git repository.

§Adding new formats and codecs

Simply implement the AudioDecoder trait for an audio decoder or the FormatReader trait for a demuxer trait and register with the appropriate registry or probe!

Re-exports§

pub use symphonia_core as core;

Modules§

default
The default module provides convenience functions and registries to get an implementer up-and-running as quickly as possible, and to reduce boiler-plate. Using the default module is completely optional and incurs no overhead unless actually used.