Crates.io | mpg123 |
lib.rs | mpg123 |
version | 0.1.2 |
source | src |
created_at | 2019-04-05 02:03:37.86481 |
updated_at | 2019-04-09 20:48:14.116484 |
description | An opinionated wrapper for mpg123-sys |
homepage | |
repository | https://github.com/kisasexypantera94/mpg123-rs |
max_upload_size | |
id | 125905 |
size | 7,604 |
An opinionated wrapper for mpg123-sys.
let decoder = Decoder::new("assets/a-Ha - Take On Me.mp3", None).unwrap();
println!("{:?}", decoder.format());
let mut samples = Vec::new();
loop {
let mut buf = vec![0; 2048];
match decoder.read(&mut buf) {
Ok(()) => {
for x in buf.into_iter() {
samples.push(x);
}
}
Err(Error::EOF) => break,
Err(e) => panic!(e),
}
}
Other examples can be found here.