eager-crowd-1678
09/11/2025, 10:08 AMtall-airline-16756
09/11/2025, 10:08 AMtall-airline-16756
09/11/2025, 10:09 AMenable_ssml=True
. Just a quick note: SSML works only with non-streaming (batch) synthesis, so make sure use_streaming
is set to False
.
Here’s a simple example to show you how to enable SSML:
from livekit.plugins import google
# Create TTS with SSML enabled (streaming must be disabled)
tts = google.TTS(
enable_ssml=True,
use_streaming=False, # Required when using SSML
voice_name="en-US-Standard-A",
language="en-US"
)
Once you have SSML enabled, you can include SSML tags in your input text to add expressive speech effects. For instance:
ssml_text = """
<speak>
Hello, welcome to <emphasis level="strong">LiveKit</emphasis>.
This text is <prosody rate="slow" pitch="+5%">spoken slowly with higher pitch</prosody>.
Say <break time="500ms"/> to add a pause.
This word is <say-as interpret-as="spell-out">livekit</say-as>.
</speak>
"""
# Use the TTS to synthesize SSML
audio_stream = tts.synthesize(ssml_text)
Here are some common SSML tags you might find useful:
• <prosody>
– to control rate, pitch, and volume
• <break>
– to insert pauses
• <emphasis>
– to emphasize words
• <say-as>
– to control how text is pronounced
• <sub>
– to substitute pronunciation
For a complete list of supported SSML tags, you can check out the Google Cloud TTS SSML reference. It’s a great resource!
If you have any questions or need more help along the way, please don’t hesitate to reach out. I’m here to support you!
Sources: Google Cloud TTS integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-azure/livekit/plugins/azure/tts.py | Google Cloud TTS integration guide | LiveKit Docseager-crowd-1678
09/11/2025, 10:12 AMtall-airline-16756
09/11/2025, 10:12 AMeager-crowd-1678
09/11/2025, 10:21 AMtall-airline-16756
09/11/2025, 10:21 AMenable_ssml=True
when you initialize your TTS instance. Here’s a quick example to guide you:
from livekit.plugins import google
tts = google.TTS(
enable_ssml=True,
use_streaming=False, # Required for SSML
voice_name="en-US-Standard-A",
language="en-US"
)
Also, just a heads-up—SSML works only in non-streaming mode. So if you have use_streaming=True
, the SSML tags won’t be processed and will be read out loud as plain text instead.
Please give this a try, and feel free to reach out if you have any more questions or need a hand with anything else. I’m here to help!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/gemini_t... | ElevenLabs TTS integration guide | LiveKit Docstall-airline-16756
09/11/2025, 10:22 AMenable_ssml=True
when you initialize the Google TTS object. Here’s a quick example to guide you:
from livekit.plugins import google
tts = google.TTS(
enable_ssml=True,
use_streaming=False, # Required for SSML support
voice_name="en-US-Standard-A",
language="en-US"
)
Also, it’s important to check that your input text is valid SSML without any malformed tags. It should look something like this:
ssml_text = """
"""
# Use the TTS to synthesize SSML
audio_stream = tts.synthesize(ssml_text)
If you’ve already enabled SSML and you’re still seeing this issue, please double-check that use_streaming
is set to False
, since SSML isn’t supported in streaming mode. Feel free to reach out if you need any more help—I’m here for you!