rust-whisper-baked-lib::wav_channel()

master
Bel LaPointe 2024-01-02 14:17:57 -07:00
parent cd339de334
commit 601fe517d7
1 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,15 @@ pub fn wav<F>(
rust_whisper_lib::wav(flags.clone(), handler_fn, flags.wav.unwrap());
}
pub fn wav_channel<F>(
mut flags: rust_whisper_lib::Flags,
handler_fn: F
) where F: FnMut(Result<rust_whisper_lib::Transcribed, String>) + Send + 'static {
flags.model_path = None;
flags.model_buffer = Some(include_bytes!("../../models/ggml-distil-medium.en.bin").to_vec());
rust_whisper_lib::wav_channel(flags, handler_fn);
}
pub fn f32_from_wav_file(path: &String) -> Result<Vec<f32>, String> {
rust_whisper_lib::f32_from_wav_file(path)
}