如何在Google的操作中从Firebase存储中添加音频? [英] How to add audio from firebase storage in actions on Google?

查看:96
本文介绍了如何在Google的操作中从Firebase存储中添加音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

非常清楚,我想知道如何在Google的操作中从Firebase存储中添加音频?几个星期以来,我一直被这个问题困扰。我已将音频上传到Firebase存储中,并从中复制了Firebase提供的链接,并将音频URL以给定格式粘贴到语音输出中。检查我的工作方式:-

 < speak> 
< audio src = https://firebasestorage.googleapis.com/v0/b/enrich-58fdf.appspot.com/o/xxx.mp3?alt=media&token=aabcd430-9d46-45f6- ad21-fdca0895123f>
< / audio>
< / speak>

但这没用。
但是几个月前,我在Google+社区中发现了一个提出类似问题的人,Allen Firstenberg回答了,他说在& 令牌。因此,在此之后,将生成新代码,即

 < speak> 
< audio src = https://firebasestorage.googleapis.com/v0/b/enrich-58fdf.appspot.com/o/xxx.mp3?alt=media&token=aabcd430-9d46- 45f6-ad21-fdca0895123f
< / audio>
< / speak>

但这还是行不通的。我认为在对SSML进行一些调整之后,此代码可能已更改或格式不同,这是我所不知道的。有人可以帮我吗?

解决方案

正如您和@matthewayne所指出的(正如我在



我还通过Dialogflow在简单响应设置中对此进行了测试,并且效果很好。


To be very clear I want to know how to add audio from firebase storage in actions on Google? I've been stuck in this question since few weeks. I've uploaded my audio in the firebase storage and from it I have copied the link provided by Firebase and and pasted the audio's URL in the given format in speech output. Check how I did:-

<speak>
<audio src="https://firebasestorage.googleapis.com/v0/b/enrich-58fdf.appspot.com/o/xxx.mp3?alt=media&token=aabcd430-9d46-45f6-ad21-fdca0895123f">
</audio>
</speak>

But this didn't work. But few months ago in the Google+ community, I found a guy who asked the question similar to this and Allen Firstenberg replied and he said to add *amp;*token between & and token. So after this, a new code generates i.e.

<speak>
<audio src="https://firebasestorage.googleapis.com/v0/b/enrich-58fdf.appspot.com/o/xxx.mp3?alt=media&amp;token=aabcd430-9d46-45f6-ad21-fdca0895123f">
</audio>
</speak>

But this also didn't work. I think after some tweaks in SSML, this code might have changed or the format is different, which I am not aware of. So can anyone help me out ?

解决方案

As both you and @matthewayne noted (and as I noted in a different answer you reference), you need to escape the & to use proper XML formatting, so it needs to be &amp;

However - I don't see a problem. I used this exact code in the Dialogflow "Text Response" area, and it works without problems:

<speak><audio src="https://firebasestorage.googleapis.com/v0/b/enrich-58fdf.appspot.com/o/welcome.mp3?alt=media&amp;token=aabcd430-9d46-45f6-ad21-fdca0895123f"></audio></speak>

I've also tested this as part of a Simple Response setting through Dialogflow, and it works fine.

这篇关于如何在Google的操作中从Firebase存储中添加音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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