在Alexa Skill SSML语音块中间添加音频

时间:2018-07-26 20:41:29

标签: alexa alexa-skills-kit alexa-skill alexa-voice-service ssml

我正在使用Node.js Alexa库:alexa-sdk

我正在尝试将音频嵌入SSML响应的中间。我可以在SSML响应的末尾添加音频标签,但不能在中间添加音频标签。

例如:

<speak> 
    You did great! 
    <audio src='https://s3.amazonaws.com/ask-soundlibrary/human/amzn_sfx_crowd_applause_05.mp3'/> 
    I had a lot of fun, I hope you did too! 
</speak>

当我以SSML的身份发送上述消息时,Alexa模拟器会合成“您做得很好!”然后停在那里。

有人知道我在做什么错或者我怎么做这项工作?在SSML文本中间嵌入音频标签不起作用吗?

即使alexa docs的音频示例位于中间,在模拟器中对我也不起作用。

谢谢

P.S。我差不多10天前在亚马逊论坛上问了这个问题,但没有回复,这并不罕见(不是最活跃的寻求帮助的地方)

1 个答案:

答案 0 :(得分:0)

我尝试了您的SSML,它工作正常。我在Alexa测试模拟器的Voice & Tone标签中对其进行了测试。

两个mp3文件(注释中的一个)都按预期顺序播放。

<speak> 
    You did great! 
    <audio src='https://s3.amazonaws.com/ask-soundlibrary/home/amzn_sfx_door_open_01.mp3'/>
    I had a lot of fun, I hope you did too! 
    <audio src='https://s3.amazonaws.com/ask-soundlibrary/human/amzn_sfx_crowd_applause_05.mp3'/>
</speak>

<audio>标签在哪里都没有关系。即使将其放在<speak>标记后

<speak> 
    <audio src='https://s3.amazonaws.com/ask-soundlibrary/human/amzn_sfx_crowd_applause_05.mp3'/>
    You did great! 
    I had a lot of fun, I hope you did too! 
</speak>