0

I wanted to speak Amharic or some other language text using TextToSpeech API but isn't work.

TextToSpeech tts = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
            @Override
            public void onInit(int status) {
                if (status != TextToSpeech.SUCCESS) {
                    tts.setLanguage(new Locale("am-ET"));
                    tts.speak("መንቦግቦግ", TextToSpeech.QUEUE_FLUSH, null, null);
                }
            }
        });

AndroidMenifest.xml

<queries>
   <intent>
       <action android:name="android.intent.action.TTS_SERVICE" />
   </intent>
</queries>
Abhi S
  • 250
  • 2
  • 18
  • What is not working? Can you edit your question to better clarify what is going wrong, what you expect to happen, any error messages? – Robin Jan 24 '23 at 13:49
  • 1
    Check if tts is supported for this language https://stackoverflow.com/questions/4872702/get-available-locales-for-text-to-speech-tts – Alexander Hoffmann Jan 24 '23 at 13:55

0 Answers0