I am going to get results of speech recognition from Google glass accourding the tutorial in https://developers.google.com/glass/develop/gdk/voice website. The RecognizerIntent returns a list but with only one member for Glass and more members for Android phone!
Any idea how to get more results from voice recognition in Google glass!
Here is some part of the code(according to this tutorial):
private static final int SPEECH_REQUEST = 0;
private void displaySpeechRecognizer() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
startActivityForResult(intent, SPEECH_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode,Intent data) {
if (requestCode == SPEECH_REQUEST && resultCode == RESULT_OK) {
List<String> results = data.getStringArrayListExtra(
RecognizerIntent.EXTRA_RESULTS);
String spokenText = results.get(0);
// Do something with spokenText.
}
super.onActivityResult(requestCode, resultCode, data);
}
Some extra information about this program:
android:minSdkVersion="19"
android:targetSdkVersion="19"
compile with: Android 4.4.2 (API 19) SDK