alexa-skills-kit - 如何在 Amazon Echo 中从偏移量播放 mp3 文件

标签 alexa-skills-kit alexa-voice-service amazon-echo

是否可以告诉 Amazon Echo(使用 SSML)从特定偏移量播放 mp3 文件?

最佳答案

使用当前的 API 无法做到这一点。如documentation for the SSML tag所示,此标签上只能设置一个可能的属性,即src。请注意,还可以指定源的要求和限制:

src: Specifies the URL for the MP3 file. Note the following requirements and limitations:

  • The MP3 must be hosted at an Internet-accessible HTTPS endpoint. HTTPS is required, and the domain hosting the MP3 file must present a valid, trusted SSL certificate. Self-signed certificates cannot be used.
  • The MP3 must not contain any customer-specific or other sensitive information.
  • The MP3 must be a valid MP3 file (MPEG version 2).
  • The audio file cannot be longer than ninety (90) seconds.
  • The bit rate must be 48 kbps. Note that this bit rate gives a good result when used with spoken content, but is generally not a high enough quality for music. You may need to use converter software to convert your MP3 files to the required codec version (MPEG version 2) and bit rate (48 kbps). One option for this is FFmpeg.

它继续说关于使用音频标签:

Include the audio tag within your text-to-speech response within the speak tag. Alexa plays the MP3 at the specified point within the text to speech. For example:

<speak>
    Welcome to Car-Fu. <audio src="https://carfu.com/audio/carfu-welcome.mp3" /> You can order a ride,
    or request a fare estimate. Which will it be? 
</speak>

如本示例中所述,给定的 mp3 将在对话框中的给定点完整播放,没有其他可用的配置。为了实现您想要的功能,您需要从您想要的时间戳开始动态创建一个新的 MP3,该时间戳符合第一个 block 引用中的要求,并通过您的响应提供该文件。

关于alexa-skills-kit - 如何在 Amazon Echo 中从偏移量播放 mp3 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35712794/

相关文章:

alexa-skills-kit - Alexa 技能套件与 Alexa 语音服务

javascript - 如何循环遍历 Alexa Intent 中的对象数组?

c# - 通过实现 Web 服务为 Alexa 托管自定义技能

javascript - 在 GET 请求中从 Node.js 中的 JSON 读取值

alexa-skills-kit - Alexa智能家居技能套路

Alexa技能套件-Lambda函数-无法验证SpeechletRequest(java)

amazon - 如何定义不是列表的自定义插槽类型?

javascript - 错误 : Unable to parse the provided SSML. 提供的文本无效 SSML

aws-lambda - 如何在开发阶段通过计算机测试亚马逊 alexa 自定义技能?