Browse and listen to thousands of radio stations across the globe right from your terminal ๐ŸŒŽ ๐Ÿ“ป ๐ŸŽตโœจ
radio rust tokio web-radio command-line-tool tui
at main 230 B view raw
1pub trait SampleParser<T> { 2 fn parse(data: &[u8]) -> T; 3} 4 5pub struct Signed16PCM; 6impl SampleParser<f64> for Signed16PCM { 7 fn parse(chunk: &[u8]) -> f64 { 8 (chunk[0] as i16 | (chunk[1] as i16) << 8) as f64 9 } 10}