我一直在 Chrome 上使用语音/语音合成,然后我意识到 Firefox 默认不允许它,必须授予特殊权限。
通过阅读这篇文章,我可以使测试工作:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API
Firefox desktop and mobile support it in Gecko 44+, without prefixes, and it can be turned on by flipping the media.webspeech.recognition.enable flag to true in about:config. The permissions settings/UI haven't yet been sorted out however, so permission can't be granted to use it by the user, so it can't be used. This will be fixed soon.
测试在这个链接中:
http://mdn.github.io/web-speech-api/speak-easy-synthesis/
但我想知道当我的客户访问我的应用程序时,我如何在他们的浏览器上允许它?我们如何请求不同的权限并允许,例如,media.webspeech.synth.enabled
?
最佳答案
作为更新,Speech Synthesis在 Firefox 49+ (2016-09) 中启用。
从 2019 年开始,将语音识别公开到网络的工作正在进行中(请参阅 bug 1248897)。 更新:截至 2021 年,错误已关闭,但该功能仍为 not enabled by default .
关于javascript - 在 Mozilla Firefox 上启用 Web Speech API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38529098/