@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_preview);
touch_color = (TextView) findViewById(R.id.touch_color);
picTaken = (ImageView) findViewById(R.id.picTaken);
// bitmap = fixRotation(MainActivity.IMG_FILE);
//picTaken.setImageBitmap(bitmap);
String toSpeak = touch_color.getText().toString();
t1.speak(toSpeak, TextToSpeech.QUEUE_ADD, null);
t1 = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status != TextToSpeech.ERROR) {
t1.setLanguage(Locale.US);
t1.setLanguage(Locale.UK);
}
}
});
}
public void onPause() {
if (t1 != null) {
t1.stop();
t1.shutdown();
}
super.onPause();
}
Run c
I want to read text field without clicking on button in android using text to speech what I actually want is that, when activity is launch text to speech converter read text show on textfield can anyone help? in used this code but it gives error i want to replace this line of code "t1.speak(toSpeak,TextToSpeech.QUEUE_FLUSH, null);" Please help.