【发布时间】:2021-01-31 18:49:03
【问题描述】:
Web 语音 api (webkitSpeechRecognition) 在 Android 手机上返回“不允许”错误。
(我在 android 设置中授予 Microphone 权限以访问 chrome 应用和网站)
桌面版 Chrome 正在运行。 但是,在 android 上不是。
(测试手机为三星 Galaxy S9,Android 版本 10,Chrome 版本 86)
我在 Android 上测试了 MicrosoftEdge、SamsungInternet 以及 Chrome。 但全部返回'not-allowed'错误。
测试页 https://www.google.com/intl/en/chrome/demos/speech.html
在 chrome 远程设备控制台上测试代码。
const a = new webkitSpeechRecognition()
a.onerror = (err) => {console.log("err:", err)}
a.start()
=> VM187:1 err: SpeechRecognitionErrorEvent {isTrusted: true, error: "not-allowed", message: "", type: "error", target: SpeechRecognition, …}
是安卓的问题吗? 我怎样才能让它工作?
【问题讨论】:
标签: android google-chrome speech-recognition webspeech-api