#audio-streaming #radio #protocols #sleep #lonely

monolib

A library implementing the lonely radio audio streaming protocol

5 releases (3 breaking)

new 0.6.0 Jul 13, 2024
0.4.0 May 21, 2024
0.3.0 Mar 24, 2024
0.2.2 Mar 15, 2024
0.2.1 Mar 15, 2024

#480 in Audio

Download history 80/week @ 2024-03-16 141/week @ 2024-03-23 61/week @ 2024-03-30 12/week @ 2024-04-06 152/week @ 2024-05-18 8/week @ 2024-05-25

310 downloads per month

MIT license

16KB
410 lines

Monolib

A library implementing the lonely radio audio streaming protocol

Documentation

Docs.rs

Examples

License

monolib is licensed under the terms of the MIT license.


lib.rs:

A library implementing the lonely radio audio streaming protocol

Example usage (play for 10 seconds):

extern crate monolib;
use std::thread::{sleep, spawn};
use std::time::Duration;

spawn(|| monolib::run("someserver:someport"));
while monolib::get_metadata().is_none() {}
let seconds = md.length / md.sample_rate as u64 / 2;
println!("Playing: {} - {} - {} ({}:{:02})", md.artist, md.album, md.title, seconds / 60, seconds % 60);
sleep(Duration::from_secs(10));
monolib::stop();

Dependencies

~2–31MB
~472K SLoC