Crates.io | libre-url2audio-lib |
lib.rs | libre-url2audio-lib |
version | 0.1.7 |
source | src |
created_at | 2024-06-06 08:16:08.12756 |
updated_at | 2024-07-08 08:03:31.494306 |
description | simple-to-use lib for playing audio streams |
homepage | https://github.com/zchira/libre-url2audio-lib |
repository | https://github.com/zchira/libre-url2audio-lib |
max_upload_size | |
id | 1263497 |
size | 84,042 |
Moved here: https://github.com/zchira/url2audio
Simple to use rust library for playing audio streams.
// 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));