javascript - 在 Mozilla Firefox 上启用 Web Speech API

标签 javascript google-chrome firefox permissions mozilla

我一直在 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 .

https://caniuse.com/#search=speech

关于javascript - 在 Mozilla Firefox 上启用 Web Speech API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38529098/

相关文章:

Javascript removeChild() 和 appendChild() VS display=none 和 display=block|inline

javascript - native .click() 在 Chrome 57 中不触发 Blob 下载

jquery - Firefox 中未发送 Ajax 请求,错误未知

javascript - 无法在joomla中使用Modal关闭弹出窗口

javascript - typescript 动态和安全地将元素添加到数组

javascript - 如何通过javascript检测用户是否在浏览器中打开了 "view-source:"?

javascript - 如何在 Chrome 中将 JavaScript 范围的末尾移动到句子

javascript - 处理类似于 Chrome 的 Omnibox 的字符串

javascript - getElementsByTagName().length 在 Firefox/Internet Explorer 中不起作用

javascript - Chrome 和 Firefox 之间的时间戳转换差异