I am using the Android\'s speech API to continuously getting input from the user. However this doesn\'t work quite well when errors occur.
What I do is restarting th
I m posting this late , but this might help some one. I was also facing same error , & also it was not listening after some random time , i tried the following & it helped me somewhat, Try doing this ,
case SpeechRecognizer.ERROR_RECOGNIZER_BUSY:
recognizer.destroy();
startSR(); // As it destroys the current objects & calling startSR() will instantiate
// objects again
Intent RC = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
if (!RC.hasExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE))
{
RC.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, "com.dummy");
}
sr.startListening(RC);
cancel
and then call startListening
startListening
Try to properly clean up after the error, e.g. call cancel
or destroy
on the SpeechRecognizer
.