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