Hiya there, how are you today?
After losing a lot of time trying to find out a way to get a male voice for the default android text-to-speech, I finally found a solution that will satisfy me. But for now :P.
The only way I could accomplish gender change (for English languages only) in Android's Text-To- Speech API was using the 'setLanguage' method. Of course, there is a way with handling the pitch of the text-to-speech but the results are kinda nasty if you ask me.
if(myTTS.isLanguageAvailable(Locale.ENGLISH)==TextToSpeech.LANG_AVAILABLE)
myTTS.setLanguage(Locale.UK);
Or
if(myTTS.isLanguageAvailable(Locale.ENGLISH)==TextToSpeech.LANG_AVAILABLE)
myTTS.setLanguage(Locale.US);
The default text-to-speech engine has a male voice for the UK setting and a female voice for the US setting. This only a temporary fix, as I have read somewhere on the jelly bean 4.2 a new voice will be introduced for the text-to-speech. We will see what it offers.
That's it for now
Until next time
Update: This solution doesn't work on all android versions, looks like newer versions contain only female voice packs. We are stuck without a choice for a while.
No comments:
Post a Comment