pub struct LocalWhisperProvider { /* private fields */ }Expand description
Local whisper.cpp provider.
Implementations§
Source§impl LocalWhisperProvider
impl LocalWhisperProvider
pub fn new(cache_dir: PathBuf) -> Self
Sourcepub fn with_runtime(
cache_dir: PathBuf,
pool: Arc<SttContextPool>,
governor: Arc<ResourceGovernor>,
) -> Self
pub fn with_runtime( cache_dir: PathBuf, pool: Arc<SttContextPool>, governor: Arc<ResourceGovernor>, ) -> Self
Construct with an explicit STT pool and governor (JOE-1784 / engine path).
pub fn with_progress(self, show: bool) -> Self
Sourcepub fn with_local_only(self, local_only: bool) -> Self
pub fn with_local_only(self, local_only: bool) -> Self
Fail closed if the model is not already on disk (no network).
Sourcepub fn with_download_progress(self, cb: DownloadProgressCallback) -> Self
pub fn with_download_progress(self, cb: DownloadProgressCallback) -> Self
Structured download progress for UI hosts (in addition to optional CLI bar).
pub fn cache_dir(&self) -> &Path
pub fn local_only(&self) -> bool
Sourcepub fn is_model_cached(&self, model: &str) -> bool
pub fn is_model_cached(&self, model: &str) -> bool
Whether the ggml file is present and passes basic integrity checks.
Sourcepub fn is_model_loaded(&self, model: &str) -> bool
pub fn is_model_loaded(&self, model: &str) -> bool
Whether a WhisperContext for this model is already loaded in this provider’s pool.
pub fn pool(&self) -> &Arc<SttContextPool> ⓘ
pub fn governor(&self) -> &Arc<ResourceGovernor> ⓘ
Sourcepub async fn preload(&self, model: &str) -> Result<PathBuf>
pub async fn preload(&self, model: &str) -> Result<PathBuf>
Download (unless local_only) and load the model into this provider’s pool.
Sourcepub async fn transcribe_pcm(
&self,
samples: &[f32],
options: &TranscriptionOptions,
) -> Result<TranscriptionResult>
pub async fn transcribe_pcm( &self, samples: &[f32], options: &TranscriptionOptions, ) -> Result<TranscriptionResult>
Transcribe a mono PCM buffer (must be WHISPER_SAMPLE_RATE Hz).
Preferred entry point for mic hosts — no temp files, no ffmpeg.
Sourcepub async fn transcribe_audio(
&self,
input: &AudioInput,
options: &TranscriptionOptions,
) -> Result<TranscriptionResult>
pub async fn transcribe_audio( &self, input: &AudioInput, options: &TranscriptionOptions, ) -> Result<TranscriptionResult>
Transcribe an owned/shared PCM buffer already wrapped as AudioInput.
Trait Implementations§
Source§impl TranscriptionProvider for LocalWhisperProvider
impl TranscriptionProvider for LocalWhisperProvider
Source§fn backend_kind(&self) -> BackendKind
fn backend_kind(&self) -> BackendKind
Backend classification.
Source§fn transcribe<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 AudioInput,
options: &'life2 TranscriptionOptions,
) -> Pin<Box<dyn Future<Output = Result<TranscriptionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn transcribe<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 AudioInput,
options: &'life2 TranscriptionOptions,
) -> Pin<Box<dyn Future<Output = Result<TranscriptionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Transcribe audio according to
options.Source§fn timestamps_reliable(&self) -> bool
fn timestamps_reliable(&self) -> bool
Whether this provider can emit trustworthy media timestamps.
Auto Trait Implementations§
impl !RefUnwindSafe for LocalWhisperProvider
impl !UnwindSafe for LocalWhisperProvider
impl Freeze for LocalWhisperProvider
impl Send for LocalWhisperProvider
impl Sync for LocalWhisperProvider
impl Unpin for LocalWhisperProvider
impl UnsafeUnpin for LocalWhisperProvider
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more