pub struct AsrSession<M>where
M: AsrModel,{ /* private fields */ }Expand description
Stateful ASR session for transcription
Wraps a model with configuration and provides high-level transcription API.
Implementations§
Source§impl<M> AsrSession<M>where
M: AsrModel,
impl<M> AsrSession<M>where
M: AsrModel,
Sourcepub fn new(model: M, config: AsrConfig) -> Result<AsrSession<M>, SpeechError>
pub fn new(model: M, config: AsrConfig) -> Result<AsrSession<M>, SpeechError>
Create a new ASR session
Sourcepub fn with_default_config(model: M) -> Result<AsrSession<M>, SpeechError>
pub fn with_default_config(model: M) -> Result<AsrSession<M>, SpeechError>
Create with default configuration
Sourcepub fn transcribe(
&self,
mel: &[f32],
mel_shape: &[usize],
) -> Result<Transcription, SpeechError>
pub fn transcribe( &self, mel: &[f32], mel_shape: &[usize], ) -> Result<Transcription, SpeechError>
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for AsrSession<M>where
M: Freeze,
impl<M> RefUnwindSafe for AsrSession<M>where
M: RefUnwindSafe,
impl<M> Send for AsrSession<M>where
M: Send,
impl<M> Sync for AsrSession<M>where
M: Sync,
impl<M> Unpin for AsrSession<M>where
M: Unpin,
impl<M> UnsafeUnpin for AsrSession<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for AsrSession<M>where
M: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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