Expand description
The ftts say synthesis path: text in, 24 kHz PCM out.
This module is where the CLI stops describing the pipeline and runs it. It resolves a
checkpoint bundle, hydrates the talker and the codec, tokenizes and wraps the text, derives the
prompt header, drives TtsEngine::synthesize over the real QwenGenerator, and hands the
generated codes to the codec decoder. What comes back is f32 samples; the WAV writing lives
in ftts-core::audio and the sink policy in crate::AudioOutput.
§Why the text is prepared before the engine runs
TtsEngine::synthesize owns text preparation, and normally that is where tokenization
happens. Here it happens once, up front, and the engine is handed a preparer that returns that
exact result. The reason is the cold text embedding: it is [151936, 2048], and materializing
it whole to serve a fifteen-token utterance would cost 1.24 GB. The gather needs the token ids,
the generator needs the gathered table, and the generator must exist before synthesize is
called — so the ids have to be known first. The engine still receives, verbatim, the
PreparedText a fresh call would have produced; nothing is skipped, only ordered.
§Speaker conditioning is derived, never invented
An x-vector prompt conditions on a 1,024-wide speaker embedding. A voice source may be either
a precomputed raw vector (1,024 little-endian f32, 4,096 bytes) or reference audio decoded
through the pinned 24 kHz log-mel front end and ECAPA encoder. Neither path accepts a
fabricated vector.
Structs§
- Denoise
Report - Derive an x-vector from an enrolled raw vector or a real reference recording.
What a
--denoiseenrollment measured, so the CLI can report the effect rather than assert it. - Dereverb
Report - What a
--dereverbenrollment measured, so the CLI reports the effect rather than asserting it. - Loaded
Model - Every weight and table one
sayneeds, hydrated once. - Model
Bundle - The model resources
ftts sayneeds, located relative to one model path. - Reference
Cleanup - Which reference-cleanup stages to run, and where each reports what it measured.
- Synthesized
Audio - A completed synthesis: the codes the talker produced and the audio they decode to.
Constants§
- DENOISE_
ARTIFACT_ RELPATH - Single-channel speech enhancement: MMSE-LSA gains, decision-directed SNR, OM-LSA presence weighting, over a noise floor initialised offline and then tracked recursively.
- SPEAKER_
VECTOR_ BYTES - Bytes in a speaker-vector file: 1,024 little-endian
f32.
Functions§
- generation_
error - A model-side failure, for callers that need the engine’s own error type.
- read_
speaker_ vector - Read a precomputed 1,024-wide speaker vector.
- replace_
speaker_ vector - Replaces an existing enrolled voice, keeping the displaced one alongside it.
- speaker_
from_ voice - Derive a speaker vector from a voice source: a raw x-vector file, or reference audio.
- synthesize
- Run one utterance end to end: text, codes, PCM.
- write_
speaker_ vector_ new - Write a raw x-vector without replacing an existing enrollment result.