How to handle ERROR_RECOGNIZER_BUSY

In my voice recognition application, I sometimes get ERROR_RECOGNIZER_BUSY. Intuitively, it requires ... repeats , right?

The problem is that this error is very undocumented, so obviously I have questions that maybe someone more experienced in this area can answer:

  • What causes this error? Is it really just a busy server (at Google)? or can it also hint at an error in my application?
  • Should I explicitly close / open the session before retrying?
  • How often to repeat? once every 1 second? every 5 seconds? Other?

Your experienced ideas are very welcome. Thank.

+22
android speech-recognition voice-recognition
Apr 27 2018-11-21T00:
source share
4 answers

I am not 100% sure, but since you have not sent messages for so long, I can also do this. It seems that you are doing something wrong in the code. As the commentator said, it would be helpful if you sent a code returning this error. However, in the source code for the Android speech recognition service, found here:

http://source-android.frandroid.com/frameworks/base/core/java/android/speech/RecognitionService.java we have a function called dispatchStopListening that seems to end the listening process. However, before this really ends, there are several checks of illegal states, including:

 else if (mCurrentCallback.mListener.asBinder() != listener.asBinder()) { listener.onError(SpeechRecognizer.ERROR_RECOGNIZER_BUSY); Log.w(TAG, "stopListening called by other caller than startListening - ignoring"); } 

This seems to mean that you are trying to end the listening process with some other guy than you started it, which causes this error. I hope this helps, but it would be very helpful if you posted the code.

+4
May 14 '11 at 22:29
source share
— -

ERROR_RECOGNIZER_BUSY is often called when you are already using the SpeechRecognizer object. (Or you didn’t close one prorelli).

0
Jun 20 '14 at 12:31 on
source share

Just add the package to the resolver intent and it should work. This is what I did.

 Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); ... intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, "com.package.name"); 
0
Jan 13 '15 at 20:06
source share

The most likely reason for ERROR_RECOGNIZER_BUSY is that you did not stop the recognition service from the main thread, and the error was ignored.

0
Mar 25 '15 at 23:26
source share



All Articles