baked streams even wav files

This commit is contained in:
bel
2024-01-01 20:56:53 -07:00
parent 97c025f04d
commit 393100973c
4 changed files with 47 additions and 303 deletions

View File

@@ -44,7 +44,7 @@ pub fn wav<F>(flags: Flags, handler_fn: F, wav_path: String) where F: FnMut(Resu
w.transcribe(&f32_from_wav_file(&wav_path).unwrap())
}
fn f32_from_wav_file(path: &String) -> Result<Vec<f32>, String> {
pub fn f32_from_wav_file(path: &String) -> Result<Vec<f32>, String> {
let f = std::fs::File::open(path);
if let Some(err) = f.as_ref().err() {
return Err(format!("failed to open wav file: {}", err));