From name alone, I can derive that stopListening() is the opposite of startListening().
I can also understand that destroy() is the opposite of createSpeechRecognizer().
But cancel()... is the opposite of what?
All I could find in the documentation about it is:
Cancels the speech recognition.
How is cancel() different from stopListening()?
Well, you cancel the SpeechRecognition, i.e. I would assume there is no result handed back to you, whereas on stopListening() you just tell the recognizer that you are done with speaking and it should do the actual recognition now (and can close the microphone). Often, you don't need to call the stopListening() yourself as the end of speech is automatically determined (automatic endpointing).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With