Skip to main content

brainwires_provider_speech/
lib.rs

1#![deny(missing_docs)]
2//! Speech (TTS / STT) provider clients for the Brainwires Agent Framework.
3//!
4//! Standalone so consumers (typically `brainwires-hardware`'s audio surface
5//! and the chat-pwa wasm bridge) can pull just the speech clients without
6//! dragging in the LLM provider stack (candle / llama.cpp / huggingface,
7//! aws-sigv4, gcp_auth, …) that lives in `brainwires-provider`.
8//!
9//! ## Native cloud providers (`native` feature)
10//! - [`azure_speech`] — Microsoft Azure Cognitive Services Speech.
11//! - [`cartesia`] — Cartesia TTS.
12//! - [`deepgram`] — Deepgram TTS / STT.
13//! - [`elevenlabs`] — ElevenLabs TTS / STT.
14//! - [`fish`] — Fish Audio TTS / ASR.
15//! - [`google_tts`] — Google Cloud Text-to-Speech.
16//! - [`murf`] — Murf AI TTS.
17//!
18//! ## Browser-native (`web-speech` feature, `wasm32` only)
19//! - `web_speech` — `speechSynthesis` (TTS) and `SpeechRecognition` (STT).
20
21/// Token-bucket rate limiter shared by every native provider.
22///
23/// Duplicated from `brainwires-provider::rate_limiter` rather than
24/// imported across crates — both copies are 146 lines of standalone
25/// stdlib-only code, and avoiding the cross-crate edge keeps this crate
26/// independent of the LLM-providers stack.
27#[cfg(feature = "native")]
28pub mod rate_limiter;
29
30#[cfg(feature = "native")]
31pub mod azure_speech;
32#[cfg(feature = "native")]
33pub mod cartesia;
34#[cfg(feature = "native")]
35pub mod deepgram;
36#[cfg(feature = "native")]
37pub mod elevenlabs;
38#[cfg(feature = "native")]
39pub mod fish;
40#[cfg(feature = "native")]
41pub mod google_tts;
42#[cfg(feature = "native")]
43pub mod murf;
44
45/// Browser-native TTS (`speechSynthesis`) and STT (`SpeechRecognition`).
46///
47/// Compiled only on `wasm32` with the `web-speech` feature enabled.
48#[cfg(all(target_arch = "wasm32", feature = "web-speech"))]
49pub mod web_speech;
50
51// ── Re-exports ─────────────────────────────────────────────────────────
52
53#[cfg(feature = "native")]
54pub use azure_speech::AzureSpeechClient;
55#[cfg(feature = "native")]
56pub use cartesia::CartesiaClient;
57#[cfg(feature = "native")]
58pub use deepgram::DeepgramClient;
59#[cfg(feature = "native")]
60pub use elevenlabs::ElevenLabsClient;
61#[cfg(feature = "native")]
62pub use fish::FishClient;
63#[cfg(feature = "native")]
64pub use google_tts::GoogleTtsClient;
65#[cfg(feature = "native")]
66pub use murf::MurfClient;