hallowed-beard-56448
12/12/2025, 8:53 PMtall-airline-16756
12/12/2025, 8:53 PMtall-airline-16756
12/12/2025, 8:53 PMuse_tts_aligned_transcript=True on your AgentSession to get word-level alignment between audio and displayed text.
1. Ensure transcription sync is on
◦ Confirm sync_transcription=True so text advances in lockstep with audio playback.
1. Reduce TTS speed for testing
◦ Lower speed to 1.0 or 0.95 temporarily. Faster rates (1.1+) compress timing and often cause the final words to arrive too late for the UI.
1. Verify you’re not closing the stream early
◦ Call .end_input() only after the final text chunk is pushed so the TTS pipeline processes the complete input.
1. Add a transcription_node to inspect timings (debug)
◦ Log TimedString start/end times to check whether the last words are emitted by TTS but arriving late to the UI.
1. Increase audio buffering if using a custom AudioSource
◦ Use a larger queue (example: queue_size_ms=2000) to avoid dropped frames under load.
Start with steps 1–3 (enable aligned transcripts, ensure sync, and lower speed). If you’d like, share the AgentSession snippet or the transcription_node logs and I’ll help interpret them.
Sources: Text and transcriptions | LiveKit docs | Cartesia TTS plugin guide | LiveKit docs | Resolving "InvalidState - failed to capture frame" errors in AudioSource | Text-to-speech (TTS) models | LiveKit Docs