title: Text to Speech Android Studio
body: <p>I am trying to do a TTS app for Arabic however whenever I want to initialize my TTS it always fails. I have no idea what I'm supposed to do to fix it. I tried to enter the TTS engine on the emulator but it doesn't show me anything. So I'm unsure whether the issue is from the emulator or my code.</p>
  <pre><code>  TTS = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
      @Override
      public void onInit(int status) {
          if (status==TextToSpeech.SUCCESS){
              int res = TTS.setLanguage(Locale.forLanguageTag(&quot;ar-XA&quot;));
              if (res == TextToSpeech.LANG_MISSING_DATA || res == TextToSpeech.LANG_NOT_SUPPORTED){
  
                  Log.e(&quot;TTS&quot;,&quot;Language not Supporter&quot;);
              }
              else{
                  speak.setEnabled(true);
              }
  
          }
          else{
              Log.e(&quot;TTS&quot;,&quot;Init Failed&quot;);
          }
      }
  });
  </code></pre>