1

So I have this code in Google Chrome:

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();
});

When I count from 1 to 10, I see this in the console:

***012345678910,

When I say "two ... seven", I see this in the console:

***27,

When I say "twenty-seven", I see this in the console:

***27,

Why are the detected numbers not being delimited?

For the above three cases, I would like to see:

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

***2,7

***27,

I'm trying to detect numbers in continuous speech here...

Eamorr
  • 9,872
  • 34
  • 125
  • 209
  • 2
    You should see all interim results... maybe your internet connection to google speech API is slow ? Also you should get the most probable result `event.results[resultsLength-1][0]`instead of the least probable `results[resultsLength-1][ArrayLength-1]`, maybe that's what messing up things – Florent Apr 07 '15 at 12:03

0 Answers0