Add better test

This commit is contained in:
Dennis Eichhorn 2017-08-26 16:03:13 +02:00
parent a78d931a85
commit 5aa746a72d

View File

@ -34,7 +34,7 @@
jsOMS.UI.Input.Voice.VoiceManager.prototype.setup = function() jsOMS.UI.Input.Voice.VoiceManager.prototype.setup = function()
{ {
let self = this; const self = this;
this.recognition.lang = this.lang; this.recognition.lang = this.lang;
this.recognition.interimResults = false; this.recognition.interimResults = false;
@ -51,6 +51,10 @@
this.recognition.onresult = function(event) { this.recognition.onresult = function(event) {
console.log(event.results[event.resultIndex][0].transcript); console.log(event.results[event.resultIndex][0].transcript);
if(self.commands.hasOwnProperty(event.results[event.resultIndex][0].transcript)) {
self.commands[event.results[event.resultIndex][0].transcript]();
}
} }
this.recognition.onspeechend = function() { this.recognition.onspeechend = function() {