3

I have an app that uses google voice speech recognition. It works perfectly, but the voice capture popup freezes sometimes (see snapshot) I have narrowed down the problem to the point where as long as a commercial app called X is active in the background, the google voice popup freezes. As soon as I close app X by swiping it away, my app's speech recognition works perfectly again.

This is the code I use to launch the speech recognition popup:

@Override
protected void onResume() {
        speechIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,app.getDemoLanguageCode());
        speechIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, app.getDemoLanguageCode());
        speechIntent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, app.getDemoLanguageCode());
        speechIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        speechIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
    }

static void openGoogleASR() {
        thisActivity.startActivityForResult(speechIntent, SPEECHRECON_CODE);
    }

This is how the speech recognition popup looks like when it freezes while app X is active in the background: Frozen popup, no captions appear

Do you know how to properly initialize my speech recognition to make it robust against other misbehaving apps?

Josh
  • 6,251
  • 2
  • 46
  • 73
  • Does app X have a 'hotword' feature, such as waiting for a user to say 'Ok Google'? – brandall May 17 '16 at 18:49
  • Nope, but it does use Google's Speech input and Text to speech @brandall – Josh May 18 '16 at 07:36
  • Is there anything in the unfiltered logcat output, before and after you swipe away app X? This behaviour I've only experienced before, when app X is bound to the mic and not releasing it in `onPause`. – brandall May 18 '16 at 08:22

0 Answers0