gotev / android-speech

Android speech recognition and text to speech made easy
http://gotev.github.io/android-speech/
Apache License 2.0
486 stars 157 forks source link

onStartOfSpeech is called too early #15

Closed mjohenneken closed 5 years ago

mjohenneken commented 7 years ago

Hi, i used the onStartOfSpeech() method of the SpeechDelegate to show the Speech Progress View. But then the progress view is shown before the speech is ready. This is because the speechRecognizer.startListening(intent) method is an async operation Instead i would have to use the SpeechRecognizerListener method onBeginningOfSpeech(). The documentation says

Called when the endpointer is ready for the user to start speaking.

So a solution would be to call the onStartOfSpeech() in onBeginningOfSpeech() or instead introduce another callback in SpeechDelegate onBeginningOfSpeech()

Anyway thanks for the work you put into this, it's a nice sample how to use the Android speech features.