Google Actions sdk无法播放Firebase存储中的ssml中的音频 [英] Google Actions sdk not playing audio in ssml from firebase storage

查看:107
本文介绍了Google Actions sdk无法播放Firebase存储中的ssml中的音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Actions SDK无法播放Firebase存储中SSML Audio标签中的音频文件。虽然我可以播放Wikipedia的.ogg格式文件。
https://upload.wikimedia。 org / wikipedia / en / 9 / 9f / Sample_of_%22Another_Day_in_Paradise%22.ogg



firebase文件
https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt=media&token=d0d08f9d-e340-478c-af00-657109683136



我正在通过发送如下所示的SSML字符串来使用它:

 <讲话> 
< audio src ='https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt = media& token = d0d08f9d-e340-478c- af00-657109683136'>
< / audio>
< / speak>

但是我遇到了以下错误:


expected_inputs [0] .input_prompt.rich_initial_prompt.items [0] .simple_response:无法解析 ssml。


可能是什么原因...这是对sdk的限制,该URL需要无参数?

解决方案

问题不是它不能使用参数-这是当解析SSML中嵌入的URL中的参数时,它不会解析&



对于这些参数,如今大多数HTML解析器使用它们来解析参数。



有几种潜在的解决方案,具体取决于您如何格式化URL。



RFC 1866曾经建议使用;代替& ;,某些服务器允许这样做。不幸的是,Firebase Storage并不是其中之一。



在大多数情况下,Firebase Storage不需要最终的令牌参数,因此在这种情况下,您可以省略它,但是



最后,您可以使用SGML编码并替换&为& (请注意前导&符号和最后一个分号)。因此,您的SSML类似于:

 < speak> 
< audio src ='https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt = media& token = d0d08f9d-e340- 478c-af00-657109683136'>
< / audio>
< / speak>

最后一种方法可能是一般用途的最佳方法。


Google Actions SDK is unable to play audio files in SSML Audio tag from firebase storage. Although I could play same .ogg format file from wikipedia. https://upload.wikimedia.org/wikipedia/en/9/9f/Sample_of_%22Another_Day_in_Paradise%22.ogg

firebase file: https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt=media&token=d0d08f9d-e340-478c-af00-657109683136

I'm using it by sending an SSML string that looks like:

<speak>
  <audio src='https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt=media&token=d0d08f9d-e340-478c-af00-657109683136'>
  </audio>
</speak>

But I'm getting the following error:

expected_inputs[0].input_prompt.rich_initial_prompt.items[0].simple_response: 'ssml' could not be parsed.

What could be the reason...Is this a limitation in actions sdk that url needs to be parameter free?

解决方案

The problem isn't that it can't use parameters - it is that when parsing parameters in URLs that are embedded in SSML it doesn't parse the & separating the parameters the way most HTML parsers parse them these days.

There are a few potential solutions for this, depending on how you can format the URL.

RFC 1866 used to recommend using a ; in place of an &, and some servers allow this. Unfortunately, Firebase Storage is not one of them.

Firebase Storage doesn't require the final token parameter in most cases, so in this case you could omit it, but that isn't a general solution to the problem.

Finally, you could use SGML encoding and replace the & as &amp; (note the leading ampersand and final semicolon). So your SSML would look something like:

<speak>
  <audio src='https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt=media&amp;token=d0d08f9d-e340-478c-af00-657109683136'>
  </audio>
</speak>

This last method is probably the best for general purposes.

这篇关于Google Actions sdk无法播放Firebase存储中的ssml中的音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆