Rhasspy TTS google Wavenet

Hello everyone!
I’m quite new to Rhasspy and currently working on a system that contains the Raspi3 B+, Matrix Creator as mic, Rhasspy 2.4.20 in a docker, Home assistant and appdaemon in virtual environments.
The basic setup seems to be working, but I would like to switch to a more natural sounding voice, hence I tried Google Wavenet.
On my first try is completely messed up my rhasspy configuration, such that my raspi went unresponsive 1 minute after booting if i didnt stop the rhasspy service. Now I resolved that issue, but nothing seems to have change concerning the voice - It always uses the espeak fallback.
Here is my code:

"text_to_speech": {
    "disable_wake": true,
    "system": "wavenet",
    "wavenet": {
      "cache_dir": "tts/googlewavenet/cache",
      "credentials_json": "tts/googlewavenet/credentials.json",
      "gender": "MALE",
      "language_code": "de-DE",
      "sample_rate": 22050,
      "url": "https://www.googleapis.com/robot/v1/metadata$
      "voice": "de-DE-Wavenet-E",
      "fallback_tts": "espeak"
"wake": {

I have doubts about the url (which url is needed here exactly?) and the voice name (in the hass documentation it says that voice overrides the gender and language feature).
It might also be something different entirely, that I didn’t think of so far.
Please let me know if I missed to mention anything and help me with this, I’ve been struggeling for quite a while now.
Thanks in advance!

Do you see anything in the logs for Rhasspy which gives a clue what is wrong? (perhaps during startup, or when you try to use TTS?)

Oh yes, I forgot to add that to the question-

  [DEBUG:16662041] GoogleWaveNetSentenceSpeaker: ready -> speaking
    [DEBUG:16662040] GoogleWaveNetSentenceSpeaker: Falling back to EspeakSentenceSpeaker
    [ERROR:16662035] GoogleWaveNetSentenceSpeaker: speak
    Traceback (most recent call last):
      File "/usr/share/rhasspy/rhasspy/tts.py", line 643, in in_ready
        self.wav_data = self.speak(message.sentence, voice, language_code)
      File "/usr/share/rhasspy/rhasspy/tts.py", line 742, in speak
        from google.cloud import texttospeech
    ImportError: cannot import name 'texttospeech' from 'google.cloud' (unknown location)
    [DEBUG:16662033] GoogleWaveNetSentenceSpeaker: Calling Wavenet (lang=de-DE, voice=de-DE-Wavenet-E, gender=MALE, rate=22050)
    [DEBUG:16662030] GoogleWaveNetSentenceSpeaker: Trying credentials at /profiles/de/tts/googlewavenet/credentials.json
    [DEBUG:16661990] SnowboyWakeListener: loaded -> listening

Hmm, not a particularly helpful error message!
I’m stuck myself, I’m afraid … perhaps someone else can help. :smile:

It seems to me, like there are some dependencies missing?


Is there anyone with the same problem? Do I need to install google-cloud-speech and google-cloud-texttospeech ‘by hand’?

I think I spotted the problem:

Calling create-venv.sh without the flag --google will exclude the Google TTS dependency.

A quick fix would be to docker exec into the running container and install the missing dependency yourself (or rerun create-venv.sh with --google).

A proper fix would be install the Google dependencies when building the Docker image but I’m not sure if @synesthesiam intended to include them in the image.

I’ve the same issue, I tried to log into docker image, install pip and then the google-cloud-texttospeech library but I still get in the logs
ImportError: cannot import name 'texttospeech' from 'google.cloud' (unknown location)

I tried that aswell, without any success. I reinstalled rhasspy in a virtual environment with the --google flag, as suggested by NullEntity. Now it works perfectly!