You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9988695
Browse filesBrowse the repository at this point in the historyBrowse files
fix(tts): drain Kokoro buffer on streamStop and add canFlush insert option
`Kokoro::stream` hung when the buffer held content without an
end-of-sentence character: the force-flush branch still used `chunkSize = 0`,
so the loop reset its skip counter without draining anything and
`streamStop(false)` never returned (#1153).
Two changes:
- Force-flush now grabs the entire searchable window instead of 0
characters, and `streamStop(false)` sets a dedicated drain flag so the
remaining tail is always released — `streamStop(false)` is now
guaranteed to return.
- `streamInsert(text, { canFlush })` lets the caller opt out of the
skipped-iterations force-flush. LLM-style callers feeding partial
tokens pass `canFlush: false` to avoid mid-sentence flushes; the
trailing tail is still drained when they call `streamStop(false)`.
The speech app's LLM-to-TTS demo is updated to pass `canFlush: false`.
Fixes#1153.
0 commit comments