Search code examples
node.jsalexa-skills-kitssml

SSML phonemes work fine in Alexa service simulator but don't work on Echo hardware


I'm creating a simple Alexa skill and want to use SSML to pronounce some non-English words properly. While everything works fine in Amazon Service Simulator, I can't get it working on actual Amazon Echo hardware.

For example, I'm sending following response from Lambda service:

var cardTitle = "Test"
var speechOutput = "Test 1, red stick in French is <phoneme alphabet=\"ipa\" ph=\"bɑˈtɔn ˈɹuʒ\">baton rouge</phoneme>"
callback(session.attributes, buildSpeechletResponse(cardTitle, speechOutput, "", true));

Amazon Service Simulator shows received response as:

{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "type": "PlainText",
      "text": "Test 1, red stick in French is <phoneme alphabet=\"ipa\" ph=\"bɑˈtɔn ˈɹuʒ\">baton rouge</phoneme>"
    },
    "reprompt": {
      "outputSpeech": {
        "type": "PlainText",
        "text": ""
      }
    },
    "shouldEndSession": true
  },
  "sessionAttributes": {}
}

If I click "Listen" in Service Simulator, the response is spelled out correctly, as Test 1, red stick in French is baton rouge.

However, when I test the same skill on actual Echo Dot hardware the response is: Test 1, red stick in French is phoneme alphabet equals ipa ph equals.......

Any ideas what I'm doing wrong?


Solution

  • I think you just need to change:

     "type": "PlainText"
    

    to be

      "type" "SSML"