Wavefile is a simple crate for parsing WAV files. It should theoretically handle any of the following:
- PCM data (most common)
- IEEE Float
- Extensible WAV files with PCM/IEEE Float data.
However, it's hard to find samples of some of these format so any feedback is appreciated :)
let wav = match WaveFile::open("/home/john/test.wav") {
Ok(w) => w,
Err(e) => println!("Oh no: {}", e)
};
println!("{} Hz, {} channel(s), {} total samples", w.sample_rate(), w.channels(), w.len());
for frame in w.iter() {
// here frame is a Vec<i32> containing one value per channel in the file.
println!("{:?}", frame);
}