Expand description
§blazen-audio-stt
Multi-backend speech-to-text engine crate for Blazen. Sibling to
blazen-audio-tts, blazen-audio-music, and blazen-audio-codec;
all four share the capability-agnostic vocabulary defined in
blazen_audio.
§Surface shape
SttBackend: capability trait extendingblazen_audio::AudioBackendthat every STT engine implements.SttBackendHandle<B>: typed wrapper for Rust callers; monomorphizes on the concrete backend.DynSttProvider: erased wrapper (Box<dyn SttBackend>) for FFI / language-binding boundaries that cannot carry generics. SeeAppendix Bof the PR-AUDIO plan for the dual-shape rationale.SttOptions: cross-backend options (model id, language hint, sample rate, device, diarization toggle).SttError: capability-agnostic error type; flattens engine-native failures into one of a small set of variants and implementsFrom<SttError> for blazen_audio::AudioError.TranscriptionResult/TranscriptionSegment: result types.StreamingTranscript: per-chunk emission from the streamingSttBackend::streamsurface.
§Backends
Each backend lives in backends under its own feature gate:
| Backend | Feature | Notes |
|---|---|---|
| whisper.cpp | whispercpp | Local CPU/GPU via the whisper-rs bindings. |
| candle | candle | Pure-Rust Whisper via candle-transformers. |
Platform-specific acceleration for the whisper.cpp backend (cuda,
metal, coreml) is exposed as opt-in no-op alias features —
consumers wanting GPU acceleration must add whisper-rs as a direct
dependency in their binary crate. See this crate’s Cargo.toml
comments for the rationale.
Re-exports§
pub use error::SttError;pub use options::SttOptions;pub use provider::DynSttProvider;pub use provider::SttBackendHandle;pub use traits::StreamingTranscript;pub use traits::SttBackend;pub use traits::TranscriptionResult;pub use traits::TranscriptionSegment;
Modules§
- backends
- Concrete
SttBackendimplementations. - error
- Error type for the
SttBackendtrait surface and backend implementations. - options
- Shared options for
SttBackendimplementations. - provider
- Dual-shape provider wrappers around an
SttBackend. - traits
- The
SttBackendtrait — capability extension ofblazen_audio::AudioBackendfor speech-to-text engines.