I have a fairly strange problem. I have a android app for which I'm adding speech recognition using the SpeechRecognizer class. I've created class implementing RecognitionListener, which just prints a log message for each event. And everything seems fine. onReadyForSpeech gets fired, onBeginningOfSpeech gets fired and onEndOfSpeech gets fired.
One important event doesn't get fired though, onResults :p
So in summery, everything seems fine, no exceptions are thrown, and I get events telling me that it successfully have started and stopped listening. Am I missing some extra for the intent which tells the SpeechRecognizer that it needs to send results to onResults or something like that?
I set up the intent as follows
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, getClass().getPackage().getName());
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5);
the SpeechRecognizer is done as
SpeechRecognizer speech = SpeechRecognizer.createSpeechRecognizer(this);
speech.setRecognitionListener(this);
And I start listening with
speech.startListening(intent);
onError. - Jong