1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Browser-native speech providers (TTS via `window.speechSynthesis`, STT via
//! `SpeechRecognition` / `webkitSpeechRecognition`).
//!
//! # Platform support
//!
//! This module is **wasm32-only**. The entire module is gated behind
//! `#[cfg(all(target_arch = "wasm32", feature = "web-speech"))]`, so on a
//! native target enabling `--features web-speech` is a no-op (the module is
//! empty rather than a compile error). All public types here wrap
//! [`web_sys`] objects that only exist in a browser-like JS environment.
//!
//! # Trait convention
//!
//! The cloud speech providers in this crate (`deepgram`, `google_tts`,
//! `elevenlabs`, `cartesia`, `azure_speech`, `fish`, `murf`) currently expose
//! their own concrete struct APIs and do not share a unified TTS / STT trait.
//! Rather than refactor those existing modules, this module defines small
//! local traits ([`TtsSink`], [`SttSource`]) that capture the shape of a
//! browser-native fire-and-forget TTS sink and an event-driven STT source.
//!
//! # Notes on `web-sys` features
//!
//! All Speech\* bindings used here are stable in `web-sys` 0.3.95 — they do
//! NOT require `RUSTFLAGS=--cfg=web_sys_unstable_apis`. If a future bump of
//! `web-sys` moves any of them behind `web_sys_unstable_apis`, callers will
//! need to set that rustflag in their build configuration.
pub use ;
pub use ;
/// Fire-and-forget TTS sink — speech is rendered by the host environment
/// (browser / OS speech engine) and there is no audio output stream returned
/// to the caller.
/// Event-driven STT source — recognition results arrive asynchronously via a
/// caller-supplied callback closure rather than a polled stream.