I am trying to do an app which can switch between the Google's default en-UK male voice (en-gb-x-rjs-phone-hmm) and female voice (en-gb-x-fis-phone-hmm). I am using two Text-To-Speech objects and, after initializing the engine for each one, I assign the corresponding voice to each of them with setVoice(voice).
mTTS1 = new TextToSpeech(this, onInitListener, packname);
mTTS2 = new TextToSpeech(this, onInitListener, packname);
And in onInit() method, when both are initialized:
mTTS1.setVoice(voice1);
mTTS2.setVoice(voice2);
'voice1' and 'voice2' are obtained calling to getVoices(), and when I get the voice name, I obtain 'en-gb-x-rjs-phone-hmm' and 'en-gb-x-fis-phone-hmm' respectively, so this make me think voices are correctly stored.
When I display two buttons for making them speak, the female voice speaks in both cases. I think it's a fact of the default voice. That happens having the female voice as the default voice. When I set the male voice as the default one, it happens just the opposite.
Something I should know that I'm missing...?
Thank you all,