title: Android Text-To-Speech Configuration and Variations
body: <p>I am currently developing an app that makes intensive use of Text-To-Speech (I am using android.speech.tts.TextToSpeech) I have been able to integrate TTS in my voice and at present, a default American US voice is what reads aloud my text.</p>
  
  <p>I would like to know how to make configurational changes to the speech engine. For example, I would like to reduce the speed at which the text is being read, swap between male and female voices and even provide support for different languages. Can anyone please help me with this information. Thanks in Advance :) </p>
  
  <p>[Below is the code I am currently using (courtesy: a very well written basic blog on android TTS), all variable have been declared I am not copying the entire code, and this code snippet works just fine.]</p>
  
  <pre><code>btnSpeak = (ImageButton) findViewById(R.id.ttsIB);    
  btnSpeak.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  speakOut();
              }
  
          });
  
  @Override
      public void onDestroy() {
          // to shutdown TTS
          if (tts != null) {
              tts.stop();
              tts.shutdown();
          }
          super.onDestroy();
      }
  
      @Override
      public void onInit(int status) 
      {
  
          if (status == TextToSpeech.SUCCESS) 
          {
              int result = tts.setLanguage(Locale.US);
  
              if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED)
              {
                  Log.e("TTS", "This Language is not supported");
              } 
              else 
              {
                  btnSpeak.setEnabled(true);
                  speakOut();
              }
  
          } 
          else 
          {
              Log.e("TTS", "Initilization Failed!");
          }
  
      }
  
      private void speakOut() 
      {
  
          String text = textVal.getText().toString();
  
          tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
      }
  </code></pre>