I'm using android.speech.SpeechRecognizer
in DICTATION_MODE
to recognize commands during a long period of time. In this mode the call to the callback method onPartialResults
delays much more than in normal mode. Does anybody know why this happen and how to avoid this delay?
This is the configuration I use for the SpeechRecognizer
:
Intent recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); recognizerIntent.putExtra("calling_package", mainActivity.getApplicationContext().getPackageName()); recognizerIntent.putExtra("android.speech.extra.DICTATION_MODE", true); recognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true); recognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 100);
A broadcast intent which can be fired to the BroadcastReceiver component specified in the meta-data defined in the DETAILS_META_DATA meta-data of an Activity satisfying ACTION_WEB_SEARCH . String.
The problem may be because of the internet speed.
Try to set EXTRA_PREFER_OFFLINE
to true and check whether the delay will be reduced
https://developer.android.com/reference/android/speech/RecognizerIntent.html#EXTRA_PREFER_OFFLINE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With