Library for playing audio.
The library is very new and not much tested.
- Play(Resume)/Pause
- Callback when audio ends
- Callback for errors
- Volume
- Seeking
- Get audio position and length
- Fade-in/fade-out on play/pause
All the decoding is done by symphonia, so the supported formats are the same as symphonia.
use raplay::{Sink, source::SineSource};
let sink = Sink::default(); // get the default output
let src = SineSource::new(1000.); // create 1000Hz sine source
sink.load(src, true)?; // play the sine wave
use std::fs::File;
use raplay::{Sink, source::Symph};
let sink = Sink::default(); // get the default output
let file = File::open("music.mp3")?; // open the mp3 file
let src = Symph::try_new(file, &Default::default())?; // create a symphonia decoder source
sink.load(src, true)?; // play the mp3 file
- If the device doesn't support the required sample rate, aliasing may occur
It is available on crates.io
- Author: BonnyAD9
- GitHub repository: BonnyAD/raplay
- Package: crates.io
- Documentation: docs.rs
- My Website: bonnyad9.github.io