9

A speech-recognition based app I am working on works well on all versions of Android starting from API 8 (Android 2.2).

But on a Nexus S 4G (Android 4.1.1), RecognitionListener will simply halt for about 1 minute, then issue an ERROR_SERVER via its onError() callback.

If spoken to within 1-2 seconds (of that onReadyForSpeech bleep), it will behave properly as expected.

What changed in JellyBean that could explain this behavior?

More importantly, is there a way to make it behave like in the older versions of Android? (i.e. keep listening, then issue ERROR_SPEECH_TIMEOUT if not spoken to within the default 10 seconds)

srf
  • 2,410
  • 4
  • 28
  • 41
  • 6
    This SNAFU of breaking backward compatibility sounds familiar... I recently came across a similar post, [with no answer in sight](http://stackoverflow.com/q/13670378/576267). Maybe it's related to [this](http://stackoverflow.com/a/11839541/576267)? Good luck! – Regex Rookie Jan 02 '13 at 04:10
  • 1
    Yes, this issue has been introduced in Jellybean. You should keep an eye on the linked post, as it has a 100 point bounty on it. – scriptocalypse Jan 02 '13 at 06:36
  • 1
    See my work around including muting the beep sound at http://stackoverflow.com/questions/14940657/android-speech-recognition-as-a-service-on-android-4-1-4-2/14950616#14950616 – Hoan Nguyen Feb 19 '13 at 07:03

2 Answers2

1

I ended up using the solution suggested by @scriptocalypse

Thank you @scriptocalypse!

(I haven't had the chance to try the solution suggested by @HoanNguyen because it implements a service which is beyond the scope of my tiny app, but it looks promising. Thank you @HoanNguyen, too.)

Community
  • 1
  • 1
srf
  • 2,410
  • 4
  • 28
  • 41
-2

There is a similar post here that offers the suggestion of simply listening again up on receiving ERROR_TIMEOUT_SPEECH result.

Community
  • 1
  • 1
Chuck Krutsinger
  • 2,830
  • 4
  • 28
  • 50