1

所以我在谷歌浏览器中有这段代码:

var recognition = null;

$(document).ready(function(){
  recognition = new webkitSpeechRecognition();
  recognition.continuous = true;
  recognition.interimResults = true;

  recognition.onresult = function(event){
    // delve into words detected results & get the latest
    // total results detected
    var resultsLength = event.results.length;
    // get length of latest results
    var ArrayLength = event.results[resultsLength-1].length;
    // get last word detected
    var saidWord = event.results[resultsLength-1][ArrayLength-1].transcript;

    console.log("***"+saidWord+",");
  }

  //don't forget to start the recognition!
  recognition.start();
});

当我从 1 数到 10 时,我在控制台中看到:

***012345678910,

当我说“两个...七个”时,我在控制台中看到了这个:

***27,

当我说“二十七”时,我在控制台中看到了这个:

***27,

为什么检测到的数字没有被分隔?

对于以上三种情况,我想看看:

***0,1,2,3,4,5,6,7,8,9,10,

***2,7

***27,

我正在尝试在这里检测连续语音中的数字...

4

0 回答 0