when does tts starts speaking in livekit ? paralle...
# ask-ai
h
when does tts starts speaking in livekit ? parallely to the llm started streaming the output or when llm complete output comes ?
t
Thanks for reaching out, Deepesh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thank you for your question! In LiveKit, TTS begins speaking once the LLM generation has started. That said, the exact behavior—whether TTS runs alongside the LLM output streaming or waits until the LLM finishes—isn't clearly specified. If you have a particular use case in mind or need a bit more clarity, please feel free to share, and I’d be happy to help you further! Sources: livekit-agents/livekit/agents/voice/agent_activity.py
h
so llm streams data to tts and tts speaks
t
Absolutely! LiveKit TTS works by streaming data directly from the LLM and speaking in real-time. The LLM produces text in small chunks, which are then sent straight to the TTS system to create audio right away. This way, the TTS can start speaking bit by bit as the text is being generated, so you don’t have to wait for the entire response to finish. I hope this helps clarify how it all comes together! Sources: agents/src/voice/agent_activity.ts | Text-to-speech (TTS) integrations | LiveKit Docs