Skip to main content

scope/input/format/
mod.rs

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}