pub struct WhisperEngine { /* private fields */ }Expand description
In-process whisper transcription engine.
Implementations§
Source§impl WhisperEngine
impl WhisperEngine
Sourcepub fn new(model_path: &Path) -> Result<Self>
pub fn new(model_path: &Path) -> Result<Self>
Loads a GGML model file and creates a WhisperEngine.
Sourcepub fn transcribe(&self, wav_path: &Path) -> Result<TranscriptionResult>
pub fn transcribe(&self, wav_path: &Path) -> Result<TranscriptionResult>
Transcribes a WAV file and returns the text.
Note: This is CPU-bound and blocking. Call via tokio::task::spawn_blocking
in an async context to avoid blocking the async runtime.
Auto Trait Implementations§
impl Freeze for WhisperEngine
impl RefUnwindSafe for WhisperEngine
impl Send for WhisperEngine
impl Sync for WhisperEngine
impl Unpin for WhisperEngine
impl UnsafeUnpin for WhisperEngine
impl UnwindSafe for WhisperEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more