I want to convert speech to text twice; first for the message and second for the number.
When I speak the text message is displayed but how can I do this with numbers.
Here is my code:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case RESULT_SPEECH: {
if (resultCode == RESULT_OK && null != data) {
ArrayList<String> text = data
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
txtText.setText(text.get(0));
Message_Speak = txtText.getText().toString();
speaknum.setText(text.get(1));
}
break;
}
}
}
}
The API does not allow you to specify how the text should be read so your code has to modify the text input so that it reads the individual numbers.
The answer is given at Android Text To Speech And Numbers