Open pdubuc opened 6 years ago
@pdubuc, result is an array. Try result[0]. I think the first value is the best, I am using it like that.
This is happening to me as well on Android (not tested on iOS).
During partial results sometimes you have higher confidence later in the array list (which I would've assumed would get sent to the first index).
The final results only have a single confidence score (instead of 5), so the wacky thing is that you get 5 results and 5 scores on the very last partial message, once you get to the final result you get 5 results and only the first score in the confidence array.
It feels like it's a bug with the SpeechRecognizer class in general since I can see the "matches: 1" being sent to the startListening command, but android is ignoring it.
So it looks like we'll have to use result[0] until the SDK gets an update :(
I'm using cordova-android 7.1.1 (sdk 27).
Problem:
startListening()
almost always returns 5 matches, despite settingmatches: 1
.Question: could someone please offer advice about how to restrict the output to return just a single/best match value?
Here is some sample code to illustrate how I have set the matches option:
Note: modifying the other options, like
prompt
works fine, but modifyingmatches
does nothing.