SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Why Is My SSML <break> Tag Being Ignored or Not Working in Twilio Studio?

Question

Why is my SSML <break> tag no longer working or being ignored inside a Twilio Studio Say/ Play widget when using a Text-to-Speech voice like Matthew Neural?

 

Product

Twilio Studio

 

Answer

When you add SSML (Speech Synthesis Markup Language) tags like <break time="9s" /> to a text block, the Twilio Text-to-Speech engine must parse the entire string as XML code.

If your text contains a raw ampersand symbol (&), it violates XML syntax rules. This causes the XML parser to fail, which results in the engine ignoring your SSML tags or failing to process the speech text altogether.

To fix this issue, you must escape the ampersand symbol by replacing it with its valid XML entity equivalent: &amp;

  • Broken Example: > Welcome to Sales & Support. <break time="2s" /> Please hold.
  • Fixed Example: > Welcome to Sales &amp; Support. <break time="2s" /> Please hold.

 

Additional Information

If your message text includes any other special XML characters within an SSML-enabled block, they must also be escaped: & as &amp;, < as &lt;, > as &gt;, " as &quot;, and ' as &apos;.

Have more questions? Submit a request
Powered by Zendesk