Skip to main content

Crate blazen_audio_tts

Crate blazen_audio_tts 

Source
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 via any-tts (Kokoro-82M, VibeVoice, Qwen3-TTS). Gated by the anytts feature flag.
  • backends::openai::OpenAiTtsBackend — HTTP client for OpenAI-compatible TTS servers (/v1/audio/speech + the de-facto /v1/voices/* extension surface). Gated by the openai feature flag (enabled by default).
  • backends::piper::PiperBackend — reserved slot for a future Piper-ONNX backend; every method currently returns TtsError::Unsupported pending 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-erased Arc<dyn TtsBackend>, used by the manager / pipeline layer.

§Feature flags

FeatureDefaultDescription
openaiyesBuilds backends::openai::OpenAiTtsBackend.
anyttsnoBuilds [backends::anytts::AnyTtsBackend].
barknoBuilds [backends::bark::BarkBackend] (Suno-AI
Bark: 3-stage AR transformer + EnCodec).
f5-ttsnoBuilds [backends::f5::F5Backend] (SWivid F5-TTS:
flow-matching DiT + Vocos vocoder).
enginenoDeprecated 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 TtsBackend implementations.

Structs§

DynTtsProvider
Erased TTS provider — used by the manager / pipeline layer when the backend is chosen at runtime.
TtsBackendHandle
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 anytts backend.

Traits§

TtsBackend
Capability trait for any TTS engine in the Blazen ecosystem.