voicemate.pipeline.chunker¶
Split streamed LLM text into speakable chunks for incremental TTS.
A chunk is emitted as soon as a sentence boundary is certain, so the first sentence is spoken while the model is still generating the rest. The very first chunk of a turn may be cut earlier at a clause boundary (comma, semicolon, colon) to reduce time-to-first-audio.
Attributes¶
Classes¶
Incremental sentence splitter. |
Module Contents¶
- voicemate.pipeline.chunker.ABBREVIATIONS: frozenset[str]¶
- class voicemate.pipeline.chunker.SpeechChunker(min_first_chars: int = 40, max_chars: int = 250)[source]¶
Incremental sentence splitter.
- Parameters:
min_first_chars – The first chunk of a turn may end at a clause boundary once it is at least this long.
max_chars – Chunks longer than this are cut at the last space.
- min_first_chars = 40¶
- max_chars = 250¶