#audio-streaming #protocols #radio #music-player #sleep #play #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

#1164 in Audio

29 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–30MB
~459K SLoC