Skip to main content

StreamingAsrEngine

Trait StreamingAsrEngine 

Source
pub trait StreamingAsrEngine: Send + Sync {
    // Required method
    fn begin_stream<'life0, 'life1, 'async_trait>(
        &'life0 self,
        opts: &'life1 StreamingOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamingSession>, AsrError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

Streaming ASR engine — feeds audio incrementally.

The contract:

  1. Caller invokes begin_stream once.
  2. Caller repeatedly invokes transcribe_chunk with successive audio buffers.
  3. Caller invokes finalize_stream once at end-of-stream and discards the engine.

Engines that don’t support streaming do not implement this trait; the crate::AsrEngine::transcribe whole-buffer fallback remains available.

Required Methods§

Source

fn begin_stream<'life0, 'life1, 'async_trait>( &'life0 self, opts: &'life1 StreamingOptions, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamingSession>, AsrError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Start a new streaming session. Returns an opaque handle the caller passes to subsequent calls.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§