Google WebSpeech API为麦克风许可提出了“不允许”的错误

问题描述 投票:3回答:3

我正在使用此网站上的Google Web Speech API:qazxsw poi

在我的Windows机器上使用Python http.server,qazxsw poi

它没有任何问题:https://developers.google.com/web/updates/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API

我上传完全相同的文件,相同的API,但它在我的CentOS远程服务器中无法为麦克风权限抛出“不允许”的错误:enter image description here

我认为这个问题可能与http服务器有关。所以我尝试了Apache Httpd,Python http.server和Nginx。他们都没有工作。

关于什么阻挡麦克风的任何想法?谢谢!

javascript google-chrome speech-recognition httpserver
3个回答
2
投票

我无法找到支持此文档的文档,但根据我自己的经验,我可以确认只有在网站上安装SSL证书后,chrome才会阻止它请求麦克风访问。


1
投票

我遇到了同样的问题(抛出enter image description here),但我使用的是HTTPS。

在我的情况下,事实证明你无法从enter image description here获取语音或启用麦克风访问。当没有在iframe中显示时,相同的代码正常工作。


1
投票

我也经历过not-allowed - 尝试从Chrome内部的跨源iframe访问麦克风。通过将iframe添加到iframe解决:

not-allowed

注意:还需要使用HTTPS作为父页面和iframe页面

参考:allow="microphone;"

© www.soinside.com 2019 - 2024. All rights reserved.