plain-hamburger-12701
11/18/2025, 5:53 AMtall-airline-16756
11/18/2025, 5:53 AMtall-airline-16756
11/18/2025, 5:54 AMplain-hamburger-12701
11/18/2025, 5:55 AMtall-airline-16756
11/18/2025, 5:56 AMsession.say() method. This handy method lets the agent speak the text you provide by using the Text-to-Speech (TTS) plugin you have set up.
Here’s a simple example to get you started:
await self.session.say("good job. task completed")
Plus, if you want to control whether the speech can be interrupted, you can do that too:
await self.session.say("good job. task completed", allow_interruptions=False)
Just make sure your agent session is configured with a TTS plugin, since that’s needed for the speech to work. If you have any questions or want me to walk you through the setup, feel free to ask—I’m here to help!
Sources: pipeline-tts/tts_node.py | meditation_assistant/README.mdoc | Agent speech and audio | LiveKit docsplain-hamburger-12701
11/18/2025, 5:57 AMtall-airline-16756
11/18/2025, 5:57 AMsession.say() method works only when there's an active session context. It’s tied to the lifecycle of an AgentSession, so you can use it only while the session is running.
To make sure session.say() works smoothly, please start by initializing and starting the session. Here's a simple example:
await session.start()
await session.say("good job. task completed")
If you're looking to use speech features outside of a session, you might want to consider a custom approach or check out other APIs. Feel free to reach out if you'd like me to explain anything further—I’m here to help!
Sources: sip-refer/README.mdoc | livekit-agents/livekit/agents/voice/agent_session.py | examples/src/custom_text_handler.ts | Node.js Agents Architecture | livekit/livekit_composite | DeepWikiplain-hamburger-12701
11/18/2025, 5:57 AMtall-airline-16756
11/18/2025, 5:58 AMsession.say() method isn’t something you can call directly from a mobile app using the LiveKit client. It’s actually a server-side method that’s part of the LiveKit Agents framework and needs to be used within the agent’s server logic.
What your mobile app can do is join a LiveKit room as a participant. From there, the agent running on the server listens to what users say in the room and uses session.say() to create speech responses through TTS.
If you’d like, I’m here to help you step through setting this up or answer any questions you have!
Sources: Agent speech and audio | LiveKit docs | Mobile SDKs (Flutter, iOS, Android) | livekit/livekit_composite | DeepWiki | livekit-agents/livekit/agents/voice/agent_session.py | examples/src/custom_text_handler.ts | basics/say_in_voice.pyplain-hamburger-12701
11/18/2025, 5:58 AMtall-airline-16756
11/18/2025, 5:59 AMvoiceAgent.say("Your message"). The TTS synthesis happens server-side, but the trigger comes right from your app.
2. Standalone TTS Stream: Your app can send text input to the server (for example, via WebSocket or data publishing). Then, the server-side agent uses a TTS plugin to generate audio, which streams back to your app or to room participants.
3. Real-Time Text Streaming: You can send incremental text (like word-by-word) from your app to the server. The agent processes this input using a streaming TTS engine (such as ElevenLabs) for quick, low-latency speech synthesis.
4. Local Playback Control: Your app receives the synthesized audio from the server and handles playback using LiveKit's client SDKs. This gives you the flexibility to build custom UI controls and create a great user experience.
All these options rely on server-side TTS synthesis, but the exciting part is that your mobile app stays in control of when and how the speech happens. If you'd like, I'm here to help you dive into any specific implementation or answer any questions you have!
Sources: examples/other/text-to-speech/README.md | Speechify TTS plugin guide | LiveKit Docs | agents/src/voice/agent_activity.ts | Text-to-speech (TTS) models | LiveKit Docs