#audio-stream #stream #player #symphonia

bin+lib libre-url2audio-lib

simple-to-use lib for playing audio streams

8 releases

new 0.1.7 Jul 8, 2024
0.1.6 Jul 8, 2024
0.1.5 Jun 15, 2024

#238 in Audio

Download history 299/week @ 2024-06-05 341/week @ 2024-06-12 19/week @ 2024-06-19

659 downloads per month

GPL-3.0 license

27KB
577 lines

Crate Badge Docs Badge

deprecation

Moved here: https://github.com/zchira/url2audio

libre-url2audio-lib

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

~9MB
~249K SLoC