I'm trying to read aloud hindi text via google TTS voice synthesizer, it is working fine in my device, since I already installed hindi voice data manually, but when upon testing on another device, which does not contain hindi voice, it is not showing prompt for downloading particular voice data. Here is the partial code:
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode == ACT_CHECK_TTS_DATA) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// Data exists, so we instantiate the TTS engine
textToSpeech = new TextToSpeech(this, this);
} else {
// Data is missing, so we start the TTS
// installation process
Intent installIntent = new Intent();
installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);
}
}
}
So, TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA
seems not working, However I do not know exactly what it does, rest of the code is fine, I believe.
Any solution to my problem?