【问题标题】:Can't play .mp3 files with dialogflow无法使用 dialogflow 播放 .mp3 文件
【发布时间】:2020-09-14 14:04:46
【问题描述】:

所以我目前正在开发一个带有 dialogflow、firebase 和 google 存储的 google 助手项目,到目前为止,我有一个正在工作的会话代理,但是在搜索了一整天之后,我找到了一种播放存储在中的 .mp3 文件的方法我的谷歌存储桶,我还是很无奈。

这是意图应该做的事情:

conv.ask(
`<speak>
  <audio src="https://storage.cloud.google.com/path_to_my_bucket/mp3_file_name">
    Couldn't read the mp3 file !
  </audio>
 </speak>`);

很遗憾,声音没有播放,我得到“无法读取 mp3 文件!”改为消息。 mp3文件符合DialogFlow documentation中的要求

这是回复:

{
  "payload": {
    "google": {
      "expectUserResponse": true,
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "<speak><audio src=\"https://storage.cloud.google.com/path_to_my_bucket/mp3_file_name\">Couldn't read the mp3 file !</audio></speak>"
            }
          }
        ]
      }
    }
  },
...

我在所有可用设备上尝试了https://console.actions.google.com/ 测试平台。

这不是授权问题:我在我的谷歌存储桶中将我的所有文件设置为公开,(这就是为什么我显然没有输入真正的音频文件链接......)

【问题讨论】:

标签: google-cloud-storage dialogflow-es actions-on-google dialogflow-es-fulfillment ssml


【解决方案1】:

很遗憾,我无法确定确切的问题,但您似乎已经解决了播放音频文件的一些要求,例如 HTTPS 和可公开访问。

请检查您的 mp3 文件是否满足此清单中的所有要求

https://developers.google.com/assistant/conversational/df-asdk/ssml#audio

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多