【问题标题】:speech recognition doesn't work in chrome on iOS语音识别在 iOS 上的 chrome 中不起作用
【发布时间】:2023-02-19 23:36:53
【问题描述】:

我在我的 NextJS 应用程序中使用标准的 JS 语音识别,它在 Chrome 网络浏览器和 Android 上运行良好。但是当我尝试在 iOS 上的 Chrome 中运行它时它不起作用,但在 Safari 中它运行良好。可能是什么问题?我检查了 Chrome 设置,那里允许访问麦克风。

这是我使用的语音识别方法:

// new speech recognition object
var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;
var recognition = new SpeechRecognition();
            
// This runs when the speech recognition service starts
recognition.onstart = function() {
    console.log("We are listening. Try speaking into the microphone.");
};

recognition.onspeechend = function() {
    // when user is done speaking
    recognition.stop();
}
              
// This runs when the speech recognition service returns result
recognition.onresult = function(event) {
    var transcript = event.results[0][0].transcript;
};
              
// start recognition
recognition.start();

【问题讨论】:

  • 确保您已授予网站访问麦克风的必要权限。您可以在您的 iOS 设备上前往“设置”>“隐私”>“麦克风”进行检查。
  • 是的,我检查了设置>隐私>麦克风,它可以访问麦克风。

标签: javascript reactjs next.js


【解决方案1】:

我也遇到了同样的问题,求解答

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-01-05
    • 2019-06-30
    • 1970-01-01
    • 1970-01-01
    • 2012-07-31
    • 1970-01-01
    • 1970-01-01
    • 2018-07-16
    相关资源
    最近更新 更多