The SpeechRecognizer was working properly for a quite a long time ,all of a sudden it is not working it is not detecting anything now .. the sample code is like this .When it is online it works properly but not in offline ,am i missing anything anywhere???
SpeechRecognizer speechRecognizer = SpeechRecognizer.createSpeechRecognizer(this);
Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
i.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
speechRecognizer.setRecognitionListener(new RecognitionListener() {
@Override
public void onReadyForSpeech(Bundle params) {
}
@Override
public void onBeginningOfSpeech() {
}
@Override
public void onRmsChanged(float rmsdB) {
}
@Override
public void onBufferReceived(byte[] buffer) {
}
@Override
public void onEndOfSpeech() {
//speechRecognizer.stopListening();
}
@Override
public void onError(int error) {
}
@Override
public void onResults(Bundle results) {
List<String> data = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
String full = data.get(0);
System.out.println(full);
}
@Override
public void onPartialResults(Bundle partialResults) {
}
@Override
public void onEvent(int eventType, Bundle params) {
}
});
speechRecognizer.startListening(i);`