TTS male voice from TTS

Is it possible to install and configure some male voices on android.speech.tts.Voice ? I read some news that Android recently released some of them, but I can not find or configure them. All the ones I'm trying to execute with the tts.setLanguage(Locale.ITALY); are female.

0
source share
3 answers

Not now. an improvement request is required so that the floor can be included in the Voice Feature Install , so that:

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

I sent emails to text providers in a speech about their inclusion - since the expectation of expansion from Google is probably years.

All you can do on average is hard code the name of the engine with a link to the floor. It is a lot of time, and there is no guarantee that they will not change the name ... Needs should be for me.

+3
source

To reinforce @brandall's answer, you can use a male / female voice and dynamically change it from the App UI. Define a TTS like this (add the tts engine to the constructor):

 tts = new TextToSpeech(context, this, "com.google.android.tts"); 

contex = activity / app

this = TextToSpeech.OnInitListener

In the tts.getVoices() list, select the desired voice by name:

 for (Voice tmpVoice : tts.getVoices()) { if (tmpVoice.getName().equals(_voiceName)) { return tmpVoice; break; } } 

NB: U need to set _voiceName , getting a hard-coded voice name from tts.getVoices() . for example: for an English man it would be: "en-us-x-sfg # male_1-local"

+3
source

Here I post a code to select male or female voice using the Google speech engine.

  Set<String> a=new HashSet<>(); a.add("female");//here you can give male if you want to select mail voice. Voice v=new Voice("en-us-x-sfg#female_2-local",new Locale("en","US"),400,200,true,a); myTTS.setVoice(v); 

The name Voices is most taken care of here. like "en-us-x-sfg # female_2-local"

You can get all the votes using the following method, and you can load it into a file.

 myTTS.getVoices() // you can get all voices of male female related information which we can set in Voice.whoever voice we want to listen.(male /female.) 
0
source

Source: https://habr.com/ru/post/1402790/


All Articles