简体   繁体   English

Web Speech API滞后时间-如何解决?

[英]Web Speech API lag time — how fix?

I am using the Web Speech API in a web page. 我正在网页中使用Web Speech API。 However, I am finding that it takes 3-5 seconds to bring back a result, which is a lot of lag time in today's web world. 但是,我发现返回结果需要3-5秒,这在当今的网络世界中是一个很大的滞后时间。 Has anyone else had this problem? 有没有其他人有这个问题? Has anyone found a solution? 有没有人找到解决方案?

Here's the barebones of what I have so far -- it works, per se, but I need it to be faster. 这是我到目前为止的准系统-它本身可以工作,但是我需要更快。

var recognition = new webkitSpeechRecognition();        
    recognition.lang = 'en-US';
    recognition.onresult = function(evt) {
        console.log(evt);
};
recognition.start();

Assuming you don't a network speed issue, using 假设您没有网络速度问题,请使用

recognition.continuous = false;

will get a faster result (with some caveats) 将获得更快的结果(有一些警告)

see my detailed answer here 在这里查看我的详细答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM