car-voice 0.15.1

Voice I/O capability for CAR — mic capture, VAD, listener/speaker traits
Documentation
//! Speech-to-text provider trait.
//!
//! Mirrors [`crate::tts::Speaker`] — each provider implements
//! [`SttProvider::transcribe`] and the listeners consume the trait object
//! rather than calling a concrete module.

use crate::Result;
use async_trait::async_trait;

/// A speech-to-text provider.
///
/// Implementations are stateless from the caller's perspective — each call is
/// independent. Concrete impls hold provider credentials and configuration in
/// the constructor.
#[async_trait]
pub trait SttProvider: Send + Sync {
    /// Transcribe a buffer of f32 PCM samples (mono, in `[-1.0, 1.0]`).
    ///
    /// Returns the trimmed transcript text, or an empty string if no speech
    /// was detected.
    async fn transcribe(&self, samples: &[f32], sample_rate: u32) -> Result<String>;
}