I am using Android Speech to text for speech recognition.
final Intent sttIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
final String language = config.getLanguage().replace('-', '_');
sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language);
sttIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, language);
sttIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);
sttIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.getPackageName());
// WORKAROUND for https://code.google.com/p/android/issues/detail?id=75347
sttIntent.putExtra("android.speech.extra.EXTRA_ADDITIONAL_LANGUAGES", new String[]{language});
return sttIntent;
I am having problem while getting phone number and email id. It is not giving proper results.
Suppose if user say "triple two triple three five hundred one" In this case STT should give me 222333501, but it is giving some number and string as result.
Suppose if user say "abc_cde@gmail.com", in this case also it is giving at the rate of and underscore as strings.
Is there any native way to solve this problem. I have referred a java utility Convert words to number to convert string to number if valid but i am not sure that would work in all cases. Any help is appreciated.