url2audio

Crates.iourl2audio
lib.rsurl2audio
version0.3.0
sourcesrc
created_at2024-07-08 06:39:03.070046
updated_at2024-10-25 12:41:54.340415
descriptionsimple-to-use lib for playing audio streams
homepagehttps://github.com/zchira/url2audio
repositoryhttps://github.com/zchira/url2audio
max_upload_size
id1295417
size119,467
(zchira)

documentation

README

Crate Badge Docs Badge

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));
Commit count: 20

cargo fmt