1

我试图通过以下方式调整 Alexa 的说话速度和音调:

outputSpeech: {
            type: "SSML",
            ssml: "<speak><prosody pitch="+50%">higher pitch</prosody></speak>"
},

执行结果成功,但是我注意到了"ssml": "<speak><prosody pitch=NaN" ,当我去模拟器测试时,Alexa回应了There was a problem with the requested skill's response

所以我尝试了几件事:

ssml: "<speak><prosody rate="150%">faster pace</prosody></speak>"

执行结果失败:“SyntaxError: Unexpected number”,

4

1 回答 1

1

您可以尝试使用此 \" 转义韵律标记属性中的双引号吗

"<speak><prosody pitch=\"+50%\">higher pitch</prosody></speak>"

或使用单引号

  const speechOutput = '<speak><prosody pitch="+50%">higher pitch</prosody></speak>';
      return handlerInput.responseBuilder
      .speak(speechOutput)
      .getResponse();
于 2018-07-05T07:20:16.790 回答