Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Python gTTS voice

I have been using the gTTS module for python 3.4 to make mp3 files of spoken text. It has been working, but all of the speech is in a certain adult female voice. Is there a way to customize the voice that gTTS reads the text in?

like image 747
Theo D. Avatar asked Jun 02 '16 19:06

Theo D.


2 Answers

Unfortunately it does not appear you can do that. The script uses this webpage to grab voice from, and it appears all you can do is have one voice per language.

Reading the actual source shows that your next best bet would be to try to pass a different language that is still English (for example, en-uk). It may produce a different result that is still English but with a different dialect.

like image 176
Kush Avatar answered Sep 21 '22 20:09

Kush


If you call "gtts-cli --all" from a command prompt, you can see that gTTS actually supports a lot of voices. However, you can only change the accents, and not the gender.

like image 31
thisisnotshort Avatar answered Sep 18 '22 20:09

thisisnotshort