webkitSpeechRecognition
var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; recognition.lang = 'zh-Hans'; ... recognition.start(); ... recognition.stop();
recognition.onresult = onRecognitionResult; function onRecognitionResult(event){ for(var i=0; i<event.results.length; i++){ var result = event.results[i]; console.log('result[i] = ' + result[0].transcript); console.log('confidence = ' + result[0].confidence); console.log('is final ? ' + result.isFinal); } }
By Oscar Tong
Everything that has a beginning has an end.