Expand description
Multi-backend text-to-speech surface for Blazen.
This crate provides one capability trait — TtsBackend — that
extends blazen_audio::AudioBackend with synthesis and voice-
management methods, plus a small set of concrete backends under
backends:
- [
backends::anytts::AnyTtsBackend] — fully local engine viaany-tts(Kokoro-82M,VibeVoice, Qwen3-TTS). Gated by theanyttsfeature flag. backends::openai::OpenAiTtsBackend— HTTP client for OpenAI-compatible TTS servers (/v1/audio/speech+ the de-facto/v1/voices/*extension surface). Gated by theopenaifeature flag (enabled by default).backends::piper::PiperBackend— reserved slot for a future Piper-ONNX backend; every method currently returnsTtsError::Unsupportedpending Wave 22 of the PR-AUDIO restructure.
Two provider wrappers compose backends with the same surface:
TtsBackendHandle<B>— monomorphized over a concrete backend, used when the backend choice is fixed at compile time.DynTtsProvider— type-erasedArc<dyn TtsBackend>, used by the manager / pipeline layer.
§Feature flags
| Feature | Default | Description |
|---|---|---|
openai | yes | Builds backends::openai::OpenAiTtsBackend. |
anytts | no | Builds [backends::anytts::AnyTtsBackend]. |
bark | no | Builds [backends::bark::BarkBackend] (Suno-AI |
| Bark: 3-stage AR transformer + EnCodec). | ||
f5-tts | no | Builds [backends::f5::F5Backend] (SWivid F5-TTS: |
| flow-matching DiT + Vocos vocoder). | ||
engine | no | Deprecated alias for anytts; will be |
| removed one release after the multi-backend | ||
| restructure ships. |
Re-exports§
pub use backends::DEFAULT_MODEL;pub use backends::DEFAULT_RESPONSE_FORMAT;pub use backends::DEFAULT_VOICE;pub use backends::OpenAiTtsBackend;pub use backends::OpenAiTtsConfig;pub use backends::OpenAiTtsSpeechRequest;pub use backends::OpenAiTtsSpeechResponse;pub use backends::PiperBackend;
Modules§
- backends
- Concrete
TtsBackendimplementations.
Structs§
- DynTts
Provider - Erased TTS provider — used by the manager / pipeline layer when the backend is chosen at runtime.
- TtsBackend
Handle - Typed, monomorphized TTS provider holding a concrete backend
B. - TtsOptions
- Per-call options for
TtsBackend::synthesize.
Enums§
- TtsError
- Error type for any TTS backend in
blazen-audio-tts. - TtsModel
- Which underlying local TTS model to load when using the
anyttsbackend.
Traits§
- TtsBackend
- Capability trait for any TTS engine in the Blazen ecosystem.