Skip to main content

SttService

Trait SttService 

Source
pub trait SttService: Send {
    // Required methods
    fn name(&self) -> &str;
    fn start<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        params: &'life1 StartParams,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn run_stt<'life0, 'async_trait>(
        &'life0 mut self,
        audio: Arc<AudioFrame>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Frame>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_muted<'life0, 'async_trait>(
        &'life0 mut self,
        muted: bool,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Streaming speech→text. Consumes InputAudio, emits InterimTranscription then final Transcription. Mirrors pipecat STTService.

Required Methods§

Source

fn name(&self) -> &str

Source

fn start<'life0, 'life1, 'async_trait>( &'life0 mut self, params: &'life1 StartParams, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn run_stt<'life0, 'async_trait>( &'life0 mut self, audio: Arc<AudioFrame>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Frame>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Feed one audio chunk; transcript frames are returned for the processor to forward downstream.

Source

fn set_muted<'life0, 'async_trait>( &'life0 mut self, muted: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trait Implementations§

Source§

impl SttService for Box<dyn SttService>

Source§

fn name(&self) -> &str

Source§

fn start<'life0, 'life1, 'async_trait>( &'life0 mut self, params: &'life1 StartParams, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn run_stt<'life0, 'async_trait>( &'life0 mut self, audio: Arc<AudioFrame>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Frame>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Feed one audio chunk; transcript frames are returned for the processor to forward downstream.
Source§

fn set_muted<'life0, 'async_trait>( &'life0 mut self, muted: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SttService for Box<dyn SttService>

Source§

fn name(&self) -> &str

Source§

fn start<'life0, 'life1, 'async_trait>( &'life0 mut self, params: &'life1 StartParams, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn run_stt<'life0, 'async_trait>( &'life0 mut self, audio: Arc<AudioFrame>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Frame>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn set_muted<'life0, 'async_trait>( &'life0 mut self, muted: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§