how does tts aligned transcript work?
# ask-ai
k
how does tts aligned transcript work?
t
Thanks for reaching out, Ethan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to explain how TTS-aligned transcription in LiveKit works! It synchronizes the transcription output perfectly with the exact speech timing from the Text-to-Speech (TTS) system. This means you get really accurate word-level or sentence-level timing, which is super helpful for real-time applications where the text needs to match the spoken audio seamlessly. To turn on this feature, you just need to set
use_tts_aligned_transcript=True
in the
AgentSession
configuration. It works great with TTS plugins like Cartesia and ElevenLabs for word-level timing, while others like LiveKit Inference provide sentence-level alignment. Once enabled, the transcription node will receive timed text chunks with start and end times, so your text display stays perfectly in sync. Just a heads-up—some text formatting like markdown or emojis might not carry over when using aligned transcripts. If you’d like, I’m here to help with any setup questions or if you want more details—just let me know! Sources: livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p... | Pipeline nodes and hooks | LiveKit Docs | Text and transcriptions | LiveKit Docs | ElevenLabs TTS plugin guide | LiveKit Docs | Cartesia TTS plugin guide | LiveKit Docs
k
will this help me with my agent knowing where in its sentence it has been interrupted so for the next response its context aware?
t
Absolutely! Using TTS-aligned transcription is a great way to help your agent recognize exactly where it was interrupted, so it can respond with better context. When you enable
use_tts_aligned_transcript=True
, the system leverages timing data from TTS providers to create transcripts that are perfectly synchronized down to the word or sentence level. When an interruption happens, the system smartly captures the partial transcript right up to that point and adds it to the conversation context with an
interrupted=True
flag. This way, your agent knows exactly what’s been said so far and can tailor its next response, avoiding any repetition and keeping the conversation flowing naturally. If you’d like, I’m here to help you set this up or answer any other questions you might have. Just let me know! Sources: Text and transcriptions | LiveKit Docs | tests/test_agent_session.py | Pipeline nodes and hooks | LiveKit Docs