Rust playback library.
Playback is handled by cpal. Format decoding can be handled either by Symphonia, or by format-specific decoders:
- MP3 by minimp3 (but defaults to Symphonia).
- WAV by hound.
- Vorbis by lewton.
- FLAC by claxon.
- MP4 and AAC (both disabled by default) are handled only by Symphonia.
See the docs for more details on backends.
The documentation contains an introduction to the library.
Rodio uses cpal
library to send audio to the OS for playback. ALSA development files are needed to build cpal
on Linux. These are provided as part of the libasound2-dev
package on Debian and Ubuntu distributions and alsa-lib-devel
on Fedora.
It is possible to build rodio
without support for audio playback. In this configuration cpal
dependency and its requirements are excluded. This configuration may be useful, for example, for decoding and processing audio in environments when the audio output is not available (e.g. in case of Linux, when ALSA is not available). See into_file
example that works with this build.
In order to use rodio
in this configuration disable default features and add the necessary ones. In this case the Cargo.toml
dependency would look like:
[dependencies]
rodio = { version = "0.20.1", default-features = false, features = ["symphonia-all"] }
For information on how to contribute to this project, please see our Contributing Guide.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0), or
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.