4

What can Google mean - "server error"? That is not a particularly helpful error. Has anyone seen this error before?

I'm posting the code here. The code usually works fine and it is only very few devices this happens on so I imagine it is more to do with the configuration of the device.

        intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,lang);
        intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS,interimResults);
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 20000);
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, 20000);
        intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 10000);
        if (android.os.Build.VERSION.SDK_INT >= 23) {
            intent.putExtra("android.speech.extra.PREFER_OFFLINE", true);
        }
        intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,maxResults);

        Handler loopHandler = new Handler(Looper.getMainLooper());
        loopHandler.post(new Runnable() {

            @Override
            public void run() {
                recognizer.startListening(intent);
            }

        });
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
mike nelson
  • 21,218
  • 14
  • 66
  • 75
  • 1
    I had the same problem, and i found that my device (LG H500f for testing) had no sd-card. When i added its sd-card it worked well. Also, check if you have network in your device. – M. Marmor Jan 31 '19 at 21:05
  • Thanks. I will put those tips in my error message to help any users that get it. I can try to repro this myself too by removing SD card and disabling network. – mike nelson Feb 02 '19 at 02:09

0 Answers0