rust-whisper-baked works with WAV
parent
871efd9b8c
commit
97c025f04d
|
|
@ -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...");
|
||||
|
|
|
|||
Loading…
Reference in New Issue