Thanks to visit codestin.com
Credit goes to lib.rs

Cargo Features

[dependencies]
rodio = { version = "0.21.1", default-features = false, features = ["playback", "wav_output", "tracing", "experimental", "noise", "wasm-bindgen", "cpal-shared-stdcxx", "flac", "mp3", "mp4", "vorbis", "wav", "symphonia-all", "symphonia-flac", "symphonia-mp1", "symphonia-mp2", "symphonia-mp3", "symphonia-mpa", "symphonia-aiff", "symphonia-caf", "symphonia-isomp4", "symphonia-mkv", "symphonia-ogg", "symphonia-aac", "symphonia-adpcm", "symphonia-alac", "symphonia-pcm", "symphonia-vorbis", "symphonia-wav", "claxon", "hound", "minimp3", "lewton", "crossbeam-channel"] }
default = flac, mp3, mp4, playback, vorbis, wav

Default feature set provides audio playback and common format support

playback default

Core functionality features

Enable audio playback

Enables cpal

Affects rodio::stream

wav_output

Enable writing audio to WAV files

Enables hound

tracing

Enable structured observability and instrumentation

Enables tracing

experimental

Experimental features using atomic floating-point operations

Enables atomic_float

Affects agc::AutomaticGainControl

noise = rand, rand_distr

Audio generation features

Enable noise generation (white noise, pink noise, etc.)

Affects source::noise

wasm-bindgen

Platform-specific features

Enable WebAssembly support for web browsers

Enables wasm-bindgen of cpal

cpal-shared-stdcxx

Use shared C++ stdlib on Android (reduces APK size, fixes linking issues)

Enables oboe-shared-stdcxx of cpal

flac default = symphonia-flac

To decode an audio source with Rodio, you need to enable the appropriate features for *both* the demuxer and the decoder.

Audio files consist of a demuxer (container format) and a decoder (audio codec), for example:
- .mp3 is an MPEG-1 Audio Layer III file, which is a container format that uses the MP3 codec
- .mp4 is an MPEG-4 container, typically (but not always) with an AAC-encoded audio stream
- .ogg is an Ogg container with a Vorbis-encoded audio stream

A reasonable set of audio demuxers and decoders for most applications.

mp3 default = symphonia-mp3
mp4 default = symphonia-aac, symphonia-isomp4
vorbis default = symphonia-ogg, symphonia-vorbis
wav default = symphonia-pcm, symphonia-wav
symphonia-all

The following features are combinations of demuxers and decoders provided by Symphonia.
Unless you are developing a generic audio player, this is probably overkill.

Enables all-codecs and all-formats of symphonia

symphonia-flac flac

Combination of decoder and native demuxer provided by Symphonia

Enables flac of symphonia

symphonia-mp1

MPEG-1 Audio Layer I

Enables mp1 of symphonia

symphonia-mp2

MPEG-1 Audio Layer II

Enables mp2 of symphonia

symphonia-mp3 mp3

MPEG-1 Audio Layer III

Enables mp3 of symphonia

symphonia-mpa

Combination of all MPEG-1 audio demuxers and decoders provided by Symphonia

Enables mpa of symphonia

symphonia-aiff

Formats (demuxers) provided by Symphonia

Enables aiff of symphonia

symphonia-caf

Enables caf of symphonia

symphonia-isomp4 mp4

Enables isomp4 of symphonia

symphonia-mkv

Enables mkv of symphonia

symphonia-ogg vorbis

Enables ogg of symphonia

symphonia-aac mp4

Codecs (decoders) provided by Symphonia

Enables aac of symphonia

symphonia-adpcm

Enables adpcm of symphonia

symphonia-alac

Enables alac of symphonia

symphonia-pcm wav

Enables pcm of symphonia

symphonia-vorbis vorbis

Enables vorbis of symphonia

symphonia-wav wav

Enables wav of symphonia

claxon

Alternative decoders and demuxers
FLAC

Enables claxon

hound

WAV

Enables hound

minimp3

MP3

Enables minimp3_fixed

lewton

Ogg Vorbis

Enables lewton

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

symphonia symphonia-aac? symphonia-adpcm? symphonia-aiff? symphonia-alac? symphonia-all? symphonia-caf? symphonia-flac? symphonia-isomp4? symphonia-mkv? symphonia-mp1? symphonia-mp2? symphonia-mp3? symphonia-mpa? symphonia-ogg? symphonia-pcm? symphonia-vorbis? symphonia-wav?

Affects decoder::symphonia

crossbeam-channel implicit feature

Enables crossbeam-channel

crossbeam-channel:

Multi-producer multi-consumer channels for message passing

rand noise?
rand_distr noise?