ambitious-dusk-46857
09/18/2025, 7:59 AMtall-airline-16756
09/18/2025, 7:59 AMtall-airline-16756
09/18/2025, 8:00 AMRealtimeModel, just set the voice parameter to the voice you’d like. For example:
from livekit.plugins import openai
model = openai.realtime.RealtimeModel(voice="shimmer")
Some great voices you can choose from are alloy, shimmer, echo, ash, ballad, coral, sage, and verse.
2. Dynamic Voice Switching During a Session:
If you want to switch things up while your session is running, you can easily update the voice using the update_options method. For example:
# Assuming 'session' is an active RealtimeSession
session.update_options(voice="echo")
This update will take effect right away for all the responses that come after.
If you have any questions or want a hand with anything else, just let me know—I’m here to help!
Sources: OpenAI Realtime API integration guide | LiveKit Docs | plugins/openai/src/tts.ts | examples/voice_agents/realtime_turn_detector.pyambitious-dusk-46857
09/18/2025, 8:45 AMtall-airline-16756
09/18/2025, 8:46 AMsay method—it’s not directly supported by the OpenAI Realtime model in LiveKit. But don’t worry! You can still get the same effect by pairing the Realtime model with a Text-to-Speech (TTS) plugin.
Here’s a friendly step-by-step on how to make it work:
1. Set up the OpenAI Realtime model with modalities=["text"] so it focuses on outputting text.
2. Add a TTS plugin like elevenlabs.TTS(), cartesia.TTS(), or openai.TTS() in your session configuration to handle turning text into speech.
For example, in Python, it might look like this:
from livekit.agents import AgentSession
from livekit.plugins import openai, elevenlabs
# Use OpenAI Realtime for text-only output
llm_plugin = openai.realtime.RealtimeModel(modalities=["text"])
# Add a TTS plugin for voice synthesis
tts_plugin = elevenlabs.TTS()
session = AgentSession(
llm=llm_plugin,
tts=tts_plugin
)
# Use the `say` method from the VoiceAgent context
session.say("Hello, this message will be spoken via the TTS plugin.")
This way, the Realtime model handles the text generation, and the TTS plugin brings those words to life with audio—giving you that say functionality you’re looking for.
If anything feels unclear or you want to dive deeper, just let me know—I’m here to help!
Sources: Realtime model integrations | LiveKit Docs | OpenAI Realtime API integration guide | LiveKit Docs | OpenAI Realtime API integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real...ambitious-dusk-46857
09/18/2025, 8:47 AMtall-airline-16756
09/18/2025, 8:48 AMgenerate_reply instead of the say method? Are you aiming to create text responses only, or are you hoping to combine it with a Text-to-Speech (TTS) plugin to get audio output? I'm here to help you figure this out!ambitious-dusk-46857
09/18/2025, 8:48 AMtall-airline-16756
09/18/2025, 8:49 AM