I'm working on a Text-To-Speech & Speech-To-Text based app. App is working fine on almost all device. But when I'm trying to use this on TV, it is giving me error "TTS Initialization failed!". I tried multiple apps from Github but this device is giving same error.
But when I tried to use T2S app from Google Play Store: https://play.google.com/store/apps/details?id=hesoft.T2S&hl=en_IN&gl=US. In T2S, both TTS as well as STT are working in my TV but none of those working in my app on same TV.
textToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
int ttsLang = textToSpeech.setLanguage(Locale.UK);
if (ttsLang == TextToSpeech.LANG_MISSING_DATA
|| ttsLang == TextToSpeech.LANG_NOT_SUPPORTED) {
Log.e(TAG, "The Language is not supported!");
} else {
Log.i(TAG, "Language Supported.");
ttsOk = true;
}
Log.i(TAG, "Initialization success.");
textToSpeech.setOnUtteranceProgressListener(new UtteranceProgressListener() {
@Override
public void onStart(String utteranceId) {
//speechRecognizer.stopListening();
}
@Override
public void onDone(String utteranceId) {
runOnUiThread(new Runnable() {
@Override
public void run() {
startListening();
}
});
}
@Override
public void onError(String utteranceId) {
}
});
} else {
Toast.makeText(getApplicationContext(), "TTS Initialization failed!", Toast.LENGTH_SHORT).show();
}
}
});