recognize strings
-
/ / TODO Perform some action to recognize strings=Help me pliz! How to bring those recognized strings in a ListView or editText Creating a dialog box for speech recognition:
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
// Specify an empty entry form
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
"or forever hold your peace");
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);
startActivityForResult(intent, VOICE_RECOGNITION);Removing speech recognition results:
@Override
protected void onActivityResult(int requestCode,
int resultCode,
Intent data) {
if (requestCode == VOICE VOICE_RECOGNITION && resultCode == RESULT_OK)
{
ArrayList results;
results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_
RESULTS);
// TODO Perform some action to recognize strings
}
super.onActivityResult(requestCode, resultCode, data);
}