pub struct Engine { /* private fields */ }Implementations§
Source§impl Engine
impl Engine
pub fn prepare( config: EngineConfig, options: EngineOptions, ) -> Result<Self, AsrError>
pub fn config(&self) -> &EngineConfig
pub fn capabilities(&self) -> &BackendCapabilities
pub fn start(&self, options: SessionOptions) -> Result<Session, AsrError>
pub fn transcribe( &self, audio: &AudioBuffer, options: SessionOptions, deadline: Instant, ) -> SessionResult
Sourcepub fn transcribe_streaming(
&self,
audio: &AudioBuffer,
options: SessionOptions,
deadline: Instant,
progress: TranscriptSnapshotSink,
) -> SessionResult
pub fn transcribe_streaming( &self, audio: &AudioBuffer, options: SessionOptions, deadline: Instant, progress: TranscriptSnapshotSink, ) -> SessionResult
Transcribe::transcribe_streaming
over the whole-recording one-shot face: the same session pipeline as
Engine::transcribe, plus a TranscriptSnapshotSink that receives each
updated snapshot of the emerging transcript while the session runs.
A snapshot is the full text so far (committed segments plus the
pending partials), not a delta — callers overwrite, never append.
For an engine that produces no incremental updates (the offline
families), the sink simply never fires and the call degenerates to
Engine::transcribe with one extra subscription.
The sink fires from a helper thread; it should be cheap (hand the
text off and return) or it delays the session. When the sink reports
the consumer is gone, the session is cancelled and the call returns
early with a Cancelled failure.
Trait Implementations§
Source§impl Transcribe for Engine
impl Transcribe for Engine
fn transcribe( &self, buffer: &AudioBuffer, options: SessionOptions, deadline: Instant, ) -> SessionResult
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Transcribe::transcribe_streaming carries progress for
this engine. The handler refuses stream=true with a 400 up front
when this is false — a wrapper that does not override the streaming
face keeps the pre-streaming contract instead of a stream that
never carries progress. Override both methods together (or
neither).Source§fn transcribe_streaming(
&self,
buffer: &AudioBuffer,
options: SessionOptions,
deadline: Instant,
progress: TranscriptSnapshotSink,
) -> SessionResult
fn transcribe_streaming( &self, buffer: &AudioBuffer, options: SessionOptions, deadline: Instant, progress: TranscriptSnapshotSink, ) -> SessionResult
stream=true requests transcribe through: same
one-shot upload, plus a sink receiving the full emerging transcript
each time it changes (a snapshot to overwrite, not a delta —
see TranscriptSnapshotSink). The default implementation refuses, so an
engine that reports Transcribe::supports_streaming but does not
override this still fails the request instead of stalling.