firstly, I am so sorry if I annoys you owner. but I tried these ways
1) change the 'result' directly to the word I want it
function recognizeSpeech() { var maxMatches = 5; var language = "en-US"; // Optional window.continuoussr.startRecognize(function("test"){ //do something }, function(errorMessage){ alert("Error message: " + errorMessage); }, maxMatches, language); }
the speech recognition totally didnt work
2) I use 'var result = ""'' before window.continuoussr.startRecognize
function recognizeSpeech() { var maxMatches = 5; var language = "en-US"; // Optional var result = "test"; window.continuoussr.startRecognize(function(result){ //do something }, function(errorMessage){ alert("Error message: " + errorMessage); }, maxMatches, language); }
it still catch all the input words from user
3) I use 'if (result == "test") inside function
function (result){ if (result == "test"){ //do something } else alert(result); }
all detected too 'else'
what is the correct way to catch a word?
and I have one question again, I change the 'maxMatches' became = 1; but still caught 5 words, why is it? Thank you very much for your time, I am so sorry again
firstly, I am so sorry if I annoys you owner. but I tried these ways
1) change the 'result' directly to the word I want it
function recognizeSpeech() { var maxMatches = 5; var language = "en-US"; // Optional window.continuoussr.startRecognize(function("test"){ //do something }, function(errorMessage){ alert("Error message: " + errorMessage); }, maxMatches, language); }
the speech recognition totally didnt work2) I use 'var result = ""'' before window.continuoussr.startRecognize
function recognizeSpeech() { var maxMatches = 5; var language = "en-US"; // Optional var result = "test"; window.continuoussr.startRecognize(function(result){ //do something }, function(errorMessage){ alert("Error message: " + errorMessage); }, maxMatches, language); }
it still catch all the input words from user3) I use 'if (result == "test") inside function
function (result){ if (result == "test"){ //do something } else alert(result); }
all detected too 'else'what is the correct way to catch a word? and I have one question again, I change the 'maxMatches' became = 1; but still caught 5 words, why is it? Thank you very much for your time, I am so sorry again