Web Speech API
JavaScript
Lightning talk by Sebastian Schöld
sebastian.schold@netlight.com
Not yet a standard
... but it's getting there
Web Speech API
-
Speech recognition
- Speech synthesis
How to use?
- in Chrome 25 + (current 30)
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 recognizer
-
onstart
is called once it begins capturing audio
-
onresult
is called for each set of results
-
onend
is called when done