From 601fe517d71197a9ac1930ebe940ed7e2ea0dcbf Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Tue, 2 Jan 2024 14:17:57 -0700 Subject: [PATCH] rust-whisper-baked-lib::wav_channel() --- rust-whisper-baked-lib/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rust-whisper-baked-lib/src/lib.rs b/rust-whisper-baked-lib/src/lib.rs index 0531c7a..988a2d2 100644 --- a/rust-whisper-baked-lib/src/lib.rs +++ b/rust-whisper-baked-lib/src/lib.rs @@ -19,6 +19,15 @@ pub fn wav( rust_whisper_lib::wav(flags.clone(), handler_fn, flags.wav.unwrap()); } +pub fn wav_channel( + mut flags: rust_whisper_lib::Flags, + handler_fn: F +) where F: FnMut(Result) + 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, String> { rust_whisper_lib::f32_from_wav_file(path) }