Sebastian Schöld
Simply a developer - occasionally presenting; mostly developing. Currently employed at Netlight Consulting (http://www.netlight.com)
Created and presented by Sebastian Schöld
var root = this;
var speechRecognition = root.webkitSpeechRecognition ||
root.mozSpeechRecognition ||
root.msSpeechRecognition ||
root.oSpeechrecognition ||
root.SpeechRecognition;
var recognition = new webkitSpeechRecognition();
// Some configuration
recognition.continuous = true;
recognition.interimResults = true;
recognition.lang = 'en-US';
// Event handlers
recognition.onstart = function() { ... }
recognition.onresult = function(event) { ... }
recognition.onerror = function(event) { ... }
recognition.onend = function() { ... }
recognition.start();
start()
activates the speech recognizeronstart
is called once it begins capturing audioonresult
is called for each set of resultsonend
is called when done recognition.interimResults = true;
var final_transcript = '';
recognition.onresult = function(event) {
var interim_transcript = '';
for (var i = event.resultIndex; i < event.results.length; ++i) {
if (event.results[i].isFinal) {
final_transcript += event.results[i][0].transcript;
} else {
interim_transcript += event.results[i][0].transcript;
}
}
};
interimResults - isFinalBy Sebastian Schöld
This is a presentation held at VG TechSjokk 2013-09-25. It's a initial look at the new Web Speech API.
Simply a developer - occasionally presenting; mostly developing. Currently employed at Netlight Consulting (http://www.netlight.com)