Voice/Speech Recognition on Android
in
Android Processing
•
2 years ago
I am working to get the speech recognition capable on the android devices to work with processing. I am having difficulty getting the results from the speech recognition engine though. I am capable of calling an intent to launch the recognition app:
- Intent intent = new Intent("android.speech.action.RECOGNIZE_SPEECH");
- startActivityForResult(intent, 0);
What is not working is the results portion:
- void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (requestCode == 1234 && resultCode == RESULT_OK) {
- ArrayList<String> matches = data.getStringArrayListExtra("RecognizeSpeech.EXTRA_RESULTS");
- }
- super.onActivityResult(requestCode, resultCode, data);
- }
I am unable to get the data out of the ArrayList. I am using the example code provided here for reference:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html
Does anyone have any ideas about how to get this to work? Thanks
1