I'm using the Android's Text To Speech default engine in my app, however the female's voice sounds like a woman over 40 and her voice is somewhat robotic.
I saw other apps that seems to use Google's built in TTS, but it sounds a lot better i.e young woman with a more natural voice.
That "natural" voice is also being used in the Android main Google Search e.g. when you press on the mic and ask a question (Siri style) like "who is the president of the US", the woman's voice will tell you the answer.
How can this voice be achieved in the code?
Basically this is what I do in my code:
TextToSpeech tts = new TextToSpeech(this, this);
.
.
.
tts.setLanguage(Locale.US);
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
In the "Accessibility" section, select Manage accessibility features. Open Select-to-speak settings. Customize your Select-to-speak voice: Change the language and preferred voice: Under “Speech," choose the language and type of voice you want to hear.
To access the Accessibility features on your Android device open the Settings app . In the Settings app, select Accessibility from the list. On the Accessibility screen, scroll down to the Screen readers section and select Text-to-speech output.
You cannot make the Android TextToSpeech sounds like a male. If you change the TextToSpeech. setPitch() value to something low, like 0.1, it will sound very bad. Your only option is to try another Text-to-Speech engine, or live with the female sounding voice.
Here is my code to use KEY_FEATURE_NETWORK_SYNTHESIS
param:
HashMap<String, String> onlineSpeech = new HashMap<>();
onlineSpeech.put(TextToSpeech.Engine.KEY_FEATURE_NETWORK_SYNTHESIS, "true");
tts.speak(speech, TextToSpeech.QUEUE_FLUSH, onlineSpeech);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With