1

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();
                }
            }
        });
  • Have you look at similar stack [questions](https://stackoverflow.com/questions/38560066/what-are-reasons-that-causes-tts-initialization-to-fail) If yes, then I think you can check on the [android issue tracker](https://source.android.com/setup/contribute/report-bugs) page. Android issues are too broad as it involves manufacturers. Adding additional details such as logs and TV manufacturer details can help too. – Betjens Jan 19 '22 at 14:54
  • It is a commercial TV. Thus, no brand associated. I don't have any additional log as it is returning status error in onInit(int status) – Priyank Android Jan 20 '22 at 21:14
  • Please read "[mcve]" and its linked pages. We need to be able to duplicate a problem before we can help fix it, so supply the minimum code necessary to do so. – the Tin Man Jan 31 '22 at 20:48
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jan 31 '22 at 20:49
  • Actually, it's a device specific issue. My code is working fine on almost all Android devices. But only the TV my client is using have this issue. I have already mentioned code I'm using along with my question. However, my client has bought another TV now and app is working fine on new TV. – Priyank Android Feb 03 '22 at 18:29

0 Answers0