Search code examples
twiliotwilio-apissml

Twilio Autopilot crashing when I use SSML?


I'm making a twilio autopilot project and I want to use SSML for the responses. Every time I trigger the intent that contains SSML, it crashes without anything showing up in the debugger. Here's what I'm doing:

{
"actions": [
    {
        "say":"<speak>Hi, how can I help you today?</speak>"
    },
    {
        "listen": true
    }
  ]
}

Please note (if this matters) that I'm using the console for my project.

What am I doing wrong? Is this not how you use SSML for autopilot? I'm not redirecting this to another function or anything fancy.

Thanks for the help!


Solution

  • Twilio Developer Evangelist here.

    According to the Voice TwiML docs for SSML (separate from the Autopilot docs at the moment), when you’re using SSML with <Say> you can skip <speak> and insert rest of the SSML inside <Say>.

    You could adjust the prosody of the text that is said in a phone call using SSML in your JSON file like this:

    {
        "actions": [
            {
                "say": "<prosody rate='fast'>Speech Synthesis Markup Language (SSML) is a W3C specification that allows developers to use XML-based markup language for assisting the generation of synthesized speech.</prosody>"
            },
            {
                "listen": true
            }
        ]
    }
    

    Hope this helps!