Is usage of SSML recommended in TTS ?
# ask-ai
p
Is usage of SSML recommended in TTS ?
t
Thanks for reaching out, mithun. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
On using SSML with TTS: yes—it's recommended when you want finer control over speech. • SSML lets you adjust pronunciation, pausing, prosody (pitch/rate/volume), emphasis, and how numbers/dates are read, which improves naturalness and fixes domain-specific terms. • Support varies by provider; LiveKit TTS plugins commonly support SSML (e.g., Google, Azure, ElevenLabs, Speechify, Resemble, Cartesia). If you share which TTS provider you’re using, I can point you to the exact SSML tags and examples: • Overview: Agent speech and audio | TTS models • Provider guides: Google, Azure, ElevenLabs, Speechify, Resemble, Cartesia Sources: Agent speech and audio | LiveKit docs | Text-to-speech (TTS) models | LiveKit Docs | Speechify TTS plugin guide | LiveKit Docs | Google Cloud TTS integration guide | LiveKit Docs | Azure Speech TTS plugin guide | LiveKit Docs
p
I am using aws polly
any updates ?
t
Following up on your AWS Polly question: yes—using SSML is recommended when you need precise control over pronunciation, pauses, and prosody. To use SSML with Polly via LiveKit: • Set the Polly plugin’s
text_type
to
ssml
• Send your SSML string as the input Example structure: • Use tags like
<break time="300ms"/>
,
<prosody rate="90%" pitch="+2st">...</prosody>
,
<say-as interpret-as="characters">ABC</say-as>
, or
<phoneme alphabet="ipa" ph="...">word</phoneme>
If you’d like, share how you’re configuring the Polly plugin now, and I can tailor a snippet. For reference: LiveKit TTS models and the Polly plugin docs linked there.
p
I am interested to increase the speed of polly speech
t
Thanks for clarifying you’re using AWS Polly. Yes—SSML is recommended with Polly when you need precise control over pronunciation, pacing, pauses, and prosody. To use SSML with LiveKit’s Polly plugin: • Set the plugin’s
text_type
to
"ssml"
and pass your SSML string. • Configure your desired
voice
,
language
, and
speech_engine
as needed. For details and examples, see the Amazon Polly plugin guide: Amazon Polly TTS plugin guide | LiveKit Docs. General SSML overview: Agent speech and audio | LiveKit docs Would you like a minimal SSML example (e.g., using
<break>
or
<prosody>
) with your chosen Polly voice? Sources: Agent speech and audio | LiveKit docs | Amazon Polly TTS plugin guide | LiveKit Docs
Regarding increasing AWS Polly speech speed: use SSML with the
prosody
tag to raise the speaking rate. To do this via LiveKit’s Polly plugin: 1. Set
text_type
to
ssml
2. Wrap your text in SSML and set a faster rate, e.g.:
Copy code
<speak>
  <prosody rate="120%">This will be spoken faster.</prosody>
</speak>
Common rate values: percentages (e.g., 110%, 130%) or keywords like `fast`/`x-fast`. Start around 115–130% and adjust to taste. References: Agent speech and audio | Amazon Polly TTS plugin guide Want a snippet matching your current config? Share how you’re invoking the Polly plugin now. Sources: Speechify TTS plugin guide | LiveKit Docs | Agent speech and audio | LiveKit docs | Amazon Polly TTS plugin guide | LiveKit Docs
p
can u provide an end to end example of invoking polly with ssml
?
t
You’re asking for an end-to-end example invoking Polly with SSML. Below is a minimal flow using the LiveKit Polly plugin to speed up speech with SSML prosody. Setup • Configure AWS credentials in your environment (per Polly plugin guide). • Select a Polly voice and engine. Example SSML (faster rate)
Copy code
<speak>
  <prosody rate="125%">This will be spoken faster with Amazon Polly.</prosody>
</speak>
Invoke via LiveKit Polly plugin (pseudo-API shape)
Copy code
# Configure the Polly TTS model
polly_tts = PollyTTS(
  voice="Joanna",            # your preferred voice
  speech_engine="neural",    # or "standard"
  text_type="ssml"           # important: treat input as SSML
)

# Synthesize speech from SSML
audio = polly_tts.synthesize("""
<speak>
  <prosody rate="125%">This will be spoken faster with Amazon Polly.</prosody>
</speak>
""")

# Play or stream 'audio' via your AgentSession / output pipeline
agent = AgentSession(tts=polly_tts)
agent.say_ssml("""
<speak>
  <prosody rate="125%">End-to-end SSML example complete.</prosody>
</speak>
""")
Key points • Set
text_type="ssml"
on the Polly TTS model. • Wrap content in
<speak>...</speak>
and control speed with
<prosody rate="...">
. If you share your language/runtime (Python or Node) and how you’re instantiating the agent, I can tailor this to a concrete snippet. Docs: Amazon Polly plugin | Agent speech and audio