rust-whisper-baked works with WAV

master
bel 2024-01-01 19:06:14 -07:00
parent 871efd9b8c
commit 97c025f04d
1 changed files with 18 additions and 0 deletions

View File

@ -6,6 +6,24 @@ use std::thread;
fn main() {
let flags = rust_whisper_lib::Flags::parse();
match flags.wav.clone() {
Some(path) => wav(flags, path),
None => channel(flags),
};
}
fn wav(flags: rust_whisper_lib::Flags, _path: String) {
rust_whisper_baked_lib::wav(flags,
|result: Result<rust_whisper_lib::Transcribed, String>| {
match result {
Ok(transcribed) => { println!("{}", transcribed.to_string()); },
Err(msg) => { eprintln!("error: {}", msg); },
};
},
);
}
fn channel(flags: rust_whisper_lib::Flags) {
let (send, recv) = std::sync::mpsc::sync_channel(100);
eprintln!("rust whisper baked lib channel...");