#radio #audio-streaming #protocols #music-player #lonely

monolib

A library implementing the lonely radio audio streaming protocol

9 releases (4 breaking)

0.7.1 Aug 26, 2024
0.7.0 Aug 26, 2024
0.6.0 Jul 13, 2024
0.4.0 May 21, 2024
0.2.2 Mar 15, 2024

#627 in Audio

Download history 9/week @ 2024-06-28 112/week @ 2024-07-12 5/week @ 2024-07-19 2/week @ 2024-07-26 395/week @ 2024-08-23 59/week @ 2024-08-30 64/week @ 2024-09-13 57/week @ 2024-09-20 13/week @ 2024-09-27 1/week @ 2024-10-04

135 downloads per month

MIT license

24KB
607 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;
use monolib::lonelyradio_types::{Settings, Encoder};

spawn(|| monolib::run("someserver:someport", Settings {encoder: Encoder::Flac, cover: -1}, "my_playlist"));
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
~470K SLoC