nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
2.11k stars 331 forks source link

how to use pico instead? #116

Open drandreaskrueger opened 4 years ago

drandreaskrueger commented 4 years ago

pico-generic instead of espeak-ng to ?

How to change (on Linux) from espeak-ng to pico-generic ?

Try this, because pico-generic is a much better sounding engine than the default espeak-ng:

sudo apt install libttspico0 libttspico-data libttspico-utils espeak speech-dispatcher-pico
sudo gedit /etc/speech-dispatcher/speechd.conf

remove the # from

AddModule "pico-generic"             "sd_generic"   "pico-generic.conf"

now you have one more output module

spd-say -O

OUTPUT MODULES espeak-ng pico-generic

list voices:

spd-say -o pico-generic -L

say something

spd-say -w -o pico-generic -y en-EN "pico is a much better sounding engine!"
spd-say -w -o pico-generic -y de-DE "Jetzt kann das deutsch!"

the default output module sounds much worse:

spd-say -w -o espeak-ng "No. This sounds less nice."

This is not working:

import pyttsx3
engine = pyttsx3.init("pico-generic")
engine.setProperty('voice', "de-DE")
engine.setProperty('gender', "male1")
engine.say('  Guten Morgen. Auf deutsch.')
engine.runAndWait()

Any hint how to do it?

drandreaskrueger commented 4 years ago

P.S.: Anyone knows how to access the "VARIANT" in

spd-say -o pico-generic -y en-EN "it's always female, how to change to male?"

? There are these VARIANTs:

spd-say -o pico-generic -L
                     NAME                 LANGUAGE                  VARIANT
                    en-US                       en                  FEMALE1
                    en-GB                       en                  FEMALE2
                    de-DE                       de                  FEMALE1
                    es-ES                       es                  FEMALE1
                    fr-FR                       fr                  FEMALE1
                    it-IT                       it                  FEMALE1
                    en-US                       en                    MALE1
                    en-GB                       en                    MALE2
                    de-DE                       de                    MALE1
                    es-ES                       es                    MALE1
                    fr-FR                       fr                    MALE1
                    it-IT                       it                    MALE1
drandreaskrueger commented 4 years ago

P.S.: There are many more voice output modules:

https://github.com/brailcom/speechd/blob/master/config/speechd.conf#L253-L272

Tetsujinfr commented 4 years ago

First, thanks vm for your guidance on installing the pico engine resources, the voice quality is definitely better than the espeak engine one!

So I think that to use the pico-generic driver, that has to be coded. From this tutorial, it says that one can use the dummy.py driver template to develop a new one. In the same repo folder, under pyttsx3/drivers/ you have the espeak.py "driver" as well as the ones for windows and mac. There is also some (limited) guidance in the full documentation from the author, specifically in its section implementing drivers. Looks quite tedious to work out tbh, at least for my limited python skills, but I think this is what is required if one wants to get other voices engine to work with this pyttsx3 library. Too sad the voice sounds so bad under Linux with this, for now at least...

drandreaskrueger commented 4 years ago

Thank you very very much for your detailed pointers. I will not code it. But your precise description of how to do it ... can be very useful.

What about assigning 'help wanted' or/and 'good first issue' to this thread. Perhaps someone else wants to work on it?

Thanks a lot.

willwade commented 9 hours ago

Note to self. We should add some docs about Linux and TTS. IMHO https://github.com/rhasspy/piper is the go to for a lot of Linux situations or Sherpa-onnx. I’ll have a think about adding piper or pico to pyttsx3.