adamant-gigabyte-17689
11/28/2025, 11:06 AMtall-airline-16756
11/28/2025, 11:06 AMtall-airline-16756
11/28/2025, 11:06 AMtts=google.beta.GeminiTTS(...) when creating the session. The plugin will stream audio automatically as the agent processes incremental text.
from livekit.plugins import google
from livekit.agents import AgentSession
session = AgentSession(
tts=google.beta.GeminiTTS(
model="gemini-2.5-flash-preview-tts",
voice_name="Zephyr",
instructions="Speak in a friendly and engaging tone.",
),
# llm, stt, etc.
)
• If you're using the TTS standalone: call the TTS instance's stream() method to receive audio chunks incrementally and play/pipe them as they arrive.
If streaming still doesn't occur, check:
• You are sending text incrementally (not only a single full string) so the engine can emit partial audio.
• Your agent or client pipeline is set to consume and play audio chunks as they arrive (default AgentSession behavior handles this).
Do you want the standalone stream() example code for consuming audio chunks, or can you share whether you’re using AgentSession or calling the TTS directly?
Sources: Gemini TTS plugin guide | LiveKit Docs | Text-to-speech (TTS) models | LiveKit Docs