2

My app waits for an input from the user for their gender: male or female. If the user chooses male, then the text-to-speech voice will be in a male's voice, if the user chooses female, it will be in female voice. The language is always English, I just want to change the gender of the TTS voice. How do I do that?

My code to initiate TTS:

TextToSpeech TTS;
TTS.setLanguage(new Locale("en_EN"));
TTS.speak("hello i am speaking in your gender",TextToSpeech.QUEUE_FLUSH,null,null);
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Hamzah Zabin
  • 93
  • 13

1 Answers1

1

The on-board TTS for Android doesn't directly support voice gender or much of anything. The standard installation has just a few fixed voices in a few languages. Users can install different TTS engines and different TTS voices, and there are methods that you can use to query the available voices, but this probably won't help you solve this problem.

I suggest that you look at Google cloud text to speech as this offers many language choices is many languages including different genders, etc.

David Wasser
  • 93,459
  • 16
  • 209
  • 274