tts-voice-creator-clone-and.../routes
mARTin-B78 34870fed27 Pipeline TTS with LLM streaming for lower latency
Replace serial LLM-wait-TTS with overlapped execution:
- LLM streams via background thread → asyncio.Queue (non-blocking event loop)
- _sentence_split() detects sentence boundaries in the token stream
- asyncio.create_task fires TTS for each sentence immediately — TTS for
  sentence 1 runs while LLM is still generating sentences 2, 3, …
- Audio chunks stream to frontend in order as each task completes
- Time-to-first-audio drops from (LLM total + TTS total) to
  roughly (LLM time-to-first-sentence + TTS latency for one sentence)

Frontend audio queue:
- enqueueAudio() / playNextAudio() chain multi-chunk responses seamlessly
- clearAudio() stops playback and cancels queue on new turn or mic click
- scheduleAutoMic() waits for queue to drain before restarting mic
- Error paths clear the queue to avoid stale audio playing after failure

Also fix missing contextlib import (silent bug when audio temp files
needed cleanup in the STT path).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 19:06:07 +02:00
..
__init__.py Security audit, modular refactor, and container-name field 2026-05-29 12:13:07 +02:00
admin.py Add version number (v1.1.0) and rewrite CHANGELOG to full Keep-a-Changelog spec 2026-05-29 13:53:31 +02:00
conversation.py Pipeline TTS with LLM streaming for lower latency 2026-05-29 19:06:07 +02:00
docker.py Security audit, modular refactor, and container-name field 2026-05-29 12:13:07 +02:00
library.py Security audit, modular refactor, and container-name field 2026-05-29 12:13:07 +02:00
settings.py Security audit, modular refactor, and container-name field 2026-05-29 12:13:07 +02:00
sources.py Security audit, modular refactor, and container-name field 2026-05-29 12:13:07 +02:00
stt.py Fix ImportError: _AUDIO_EXTS imported from wrong module in routes/stt.py 2026-05-29 14:57:06 +02:00
tts.py Security audit, modular refactor, and container-name field 2026-05-29 12:13:07 +02:00