Trait AudioTranscriber

Source
pub trait AudioTranscriber {
    // Required method
    fn transcribe(&self, audio: &[u8]) -> impl Stream<Item = String> + Send;
}
Expand description

Transcribes audio to text.

§Example

use ai_types::AudioTranscriber;
use futures_core::Stream;

struct MyTranscriber;

impl AudioTranscriber for MyTranscriber {
    fn transcribe(&self, audio: &[u8]) -> impl Stream<Item = String> + Send {
        futures_lite::stream::iter(vec!["Hello world".to_string()])
    }
}

Required Methods§

Source

fn transcribe(&self, audio: &[u8]) -> impl Stream<Item = String> + Send

Transcribes audio data to text.

Returns a Stream of transcribed text chunks.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§