mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-14 16:38:39 +00:00
Add better test
This commit is contained in:
parent
a78d931a85
commit
5aa746a72d
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user