Search code examples
androidspeech-recognitionandroid-4.2-jelly-bean

SpeechRecognizer not detecting end of speech on jelly bean


Am using SpeechRecognizer directly and I have implemented custom RecognitionListener. Speech recognition works fine on android other than jelly bean. On jelly bean Recognizer is not able to detect end of speech.

My code is as below

 speechRecognizer = SpeechRecognizer.createSpeechRecognizer(getApplicationContext());
speechRecognizer.setRecognitionListener(new CustomListener());  
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                    RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
                    "com.somemodule");
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);
speechRecognizer.startListening(intent);

What am I missing? I found one more person reporting the issue here but no one has provided the solution


Solution

  • I noticed that, SpeechRecognizer does not work on certain network. In my case it never worked when i tried to access internet via Intranet but worked on 3G network/ public internet.

    Similarly built-in voice search failed on Intranet