Skip to main content

rightkit_tts/
lib.rs

1//! Shared text-to-speech runtime.
2//!
3//! Feature boundaries (see `Cargo.toml`):
4//! - `system`: no-model OS voice backend (`say` on macOS, SAPI on Windows) with a
5//!   word-timed manifest that can be passed to `rightkit-transcript`.
6//! - `client`: QTS worker client (spawn, chunking, model manifest verification).
7//! - `engine`: the vendored Qwen3-TTS worker (`worker`, binary `rightkit-tts-worker`); implies `client`.
8//!
9//! `wav` and the sample-rate constants are always available.
10
11pub mod wav;
12
13#[cfg(feature = "client")]
14pub mod chunk;
15#[cfg(feature = "client")]
16pub mod client;
17#[cfg(feature = "client")]
18pub mod mode_location;
19#[cfg(feature = "client")]
20pub mod models;
21#[cfg(feature = "client")]
22pub mod protocol;
23#[cfg(feature = "system")]
24pub mod system;
25#[cfg(feature = "client")]
26pub mod worker_args;
27
28#[cfg(feature = "client")]
29pub use client::{QtsClient, QtsError, SynthOptions, SynthResult};
30#[cfg(feature = "client")]
31pub use mode_location::ModeLocation;
32#[cfg(feature = "client")]
33pub use protocol::{Mode, PRESET_SPEAKERS};
34#[cfg(feature = "system")]
35pub use system::{
36    chunk_sentences, SentenceChunk, SystemTts, SystemTtsError, SystemTtsManifest, SystemTtsOptions,
37    SystemTtsResult, SystemTtsSegment,
38};
39
40#[cfg(feature = "engine")]
41pub mod worker;
42
43pub const QTS_SAMPLE_RATE_HZ: u32 = 24_000;
44pub const SAMPLE_RATE_HZ: u32 = QTS_SAMPLE_RATE_HZ;