androidspeech-recognitionbindservice

SpeechRecognizer, bind to recognition service failed


I used SpeechRecognizer on android to recognize the User's voice. It worked well until uninstall the Google App. (https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en)

I updated the Google App, but I got errors such as "bind to recognition service failed". How can I make the app run successfully?

What should I do to use SpeechRecognizer normally?

Thanks.


Solution

  • Every time the Google app is updated some way or the other there is always an issue with the speech recognizer callbacks. Either Google periodically changes their timeout clause or some weird issues like yours pops out of nowhere.

    You need to make your code dynamic in such a way that even if there is an error in the speech callback methods, you need to catch that error and try listening again automatically. This has been discussed widely in this post and there are plenty of answers provided for you to check and implement them based on your requirement.

    If you don't want this you can always try out DroidSpeech library which takes care of these speech error issues whenever something pops up and provides you with continuous voice recognition.

    Just implement the library using Gradle and add the following lines of code.

    DroidSpeech droidSpeech = new DroidSpeech(this, null); droidSpeech.setOnDroidSpeechListener(this);

    To start listening to the user call the below code,

    droidSpeech.startDroidSpeechRecognition();

    And you will get the voice result in the listener method,

    @Override

    public void onDroidSpeechFinalResult(String finalSpeechResult, boolean droidSpeechWillListen) {

    }