Android Text to Speech Male Voice

Android TTS male voices

No, not at present. An enhancement request is needed so that the gender can be included in the Voice Feature Set, such that:

Voice[Name: en-AU-afi-network, locale: en_AU, quality: 500, latency: 400, requiresNetwork: true, features: [networkTimeoutMs, networkRetriesCount, male]]

I have sent emails to Text to Speech providers about including this - as waiting for an enhancement from Google is probably years away.

All you can do in the mean time, is hard-code the name of the engine with a reference to the gender. It's time consuming and there's no guarantee that they won't change the name.... Needs must for me.

How to change gender of text to speech voice in an Android project?

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.

Saving TTS as file with a custom voice (male voice)

You have to use synthesizeToFile().

Voice voiceobj = new Voice("en-us-x-sfg#male_1-local",
Locale.getDefault(), 1, 1, false, null);

tts.setVoice(voiceobj);
String text = "Hai buddy, how are you?";
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null,null);
Bundle params = new Bundle();
params.putString(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, text);
// Define your destination file.
// Remember to create the directories in which the file will be inserted if they are not created yet.
final String dest = "/path/to/dest/file_name.wav";
// Write it to the specified file.
tts.synthesizeToFile(text, params, dest);

Changing the default voice of Android's Text To Speech

I've eventually managed to find a solution. I just needed to use the KEY_FEATURE_NETWORK_SYNTHESIS param which is available on jellybean. The default offline mode has the awful robotic sound



Related Topics



Leave a reply



Submit