dalvallana / ContinuousSpeechRecognizer

Cordova/Phonegap plugin for Android SpeechRecognizer feature.
11 stars 13 forks source link

I tried 3 ways but still cant detect what I want #4

Open shioshikei opened 8 years ago

shioshikei commented 8 years ago

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

tsalitsh commented 8 years ago

hey I have same problem here, do you already get answer?