how to use google beta tts To use it is basically ...
# ask-ai
r
how to use google beta tts To use it is basically this:
Copy code
from livekit.plugins.google.beta import gemini_tts  
  
tts = gemini_tts.TTS(model="gemini-2.5-pro-preview-tts")
t
Thanks for reaching out, Phanos. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! If you want to use Google Beta TTS (Gemini TTS) with LiveKit, here’s a simple step-by-step to get you started: 1. First, install the LiveKit Google plugin:
Copy code
pip install "livekit-agents[google]~=1.0"
1. Next, import the modules you’ll need:
Copy code
from livekit.plugins import google
1. Now, set up and configure your Gemini TTS:
Copy code
tts = google.beta.GeminiTTS(
    model="gemini-2.5-flash-preview-tts",
    voice_name="Kore",
    instructions="Say the text with a proper tone"
)
1. Finally, use the TTS in an AgentSession:
Copy code
from livekit.agents import AgentSession

session = AgentSession(
    tts=tts,
    # ... other components like LLM, STT
)
Just a heads-up: make sure you’re authenticated with Google Cloud by providing your credentials through
api_key
,
credentials_info
, or
credentials_file
. And if you want, you can easily tweak the voice with the
voice_name
parameter. If you hit any bumps or have questions, I’m here to help—just give me a shout!
r
CAn I specify a language?
t
Absolutely! You can specify a language for Google Beta TTS in LiveKit by using the
language
parameter. Just pop in the language code you want (like
en-US
for American English or
fr-FR
for French). Here’s a quick example:
Copy code
from livekit.plugins import google

google_tts = google.TTS(
    language="fr-FR",  # Specify the language
    voice_name="fr-FR-Standard-A",
    gender="female"
)
Just make sure the language code matches one of the supported voices and languages. If you want to see all the options, you can check out the Google TTS supported voices and languages. Feel free to reach out if you have any more questions or need a hand!