6 releases
0.2.4 | Aug 2, 2024 |
---|---|
0.2.3 | Jul 30, 2024 |
0.1.6 | Jul 8, 2024 |
#904 in Audio
133 downloads per month
36KB
818 lines
url2audio
Simple to use rust library for playing audio streams.
How to use?
// create Player instance
let mut p = Player::new();
// open audio stream from url:
// example: https://something.from.the.web/xyz.mpr
let res = p.open(src);
println!("duration: {}", p.duration());
sleep(std::time::Duration::from_secs(3));
// pause playback
p.pause();
sleep(std::time::Duration::from_secs(3));
// resume playback
p.play();
println!("Resume at: {}", p.current_position());
sleep(std::time::Duration::from_secs(3));
// seek
p.seek(600.0);
sleep(std::time::Duration::from_secs(5));
Dependencies
~9–41MB
~684K SLoC