Registry / utility / rodio
library0.22.2rscratesunverified

Audio playback and recording library for Rust.

# Cargo.toml [dependencies] rodio = "0.22.2"
INSTALL
IMPORT
SIG · RODIO
R
rodio
utilityrustv0.22.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OutputStream
use rodio::OutputStream;

Plays an MP3 file using the default audio output.

use rodio::{OutputStream, source::Source}; use std::fs::File; use std::io::BufReader; let (_stream, stream_handle) = OutputStream::try_default().unwrap(); let file = BufReader::new(File::open("audio.mp3").unwrap()); let source = rodio::Decoder::new(file).unwrap(); stream_handle.play_raw(source.convert_samples()).unwrap(); std::thread::sleep(std::time::Duration::from_secs(5));
Debug
Known issues
gotchaRequires a backend (e.g., ALSA, PulseAudio, or WASAPI) which may not be available on all systems.
fix
Ensure the appropriate system audio libraries are installed or use a feature flag like `alsa`.
affects: >=0.22.0
Upgrade
Version history
0.22.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
rodio — cargo add rodio · libregistry