Google Cloud TTS - Configuration of mycroft.conf

Dear team,
I’m trying to use a voice from google cloud TTS. I added the following in mycroft.conf, unfortunately I only get the error message “can not connect to mycroft server”. When I configure mycroft.conf to use another STT, I get no error message. Can you help me with how to edit the the conf to use google cloud voice? How can I choose, which of the Google Cloud voices I want to use?

“stt”: {
“module”: “google_cloud”,
“google_cloud”: {
“lang”: “de-de”,
“credential”: {
“json”: {
“type”: “service_account”,
“project_id”: “german-r…3950”,
“private_key_id”: “e24332…c”,
“private_key”: “-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n”,
“client_email”: “test-156@german-…eaccount. com”,
“client_id”: “10012…888”,
“auth_uri”: “https://accounts.google.com/o/oauth2/auth”,
“token_uri”: “https://oauth2.googleapis.com/token”,
“auth_provider_x509_cert_url”: “…”,
“client_x509_cert_url”: “…”
}}}}

Hey Jonny,

I just had a quick look and am wondering if it also requires the google-cloud-speech Python package as Google have modified their authentication mechanism.

Can you try installing this in the Mycroft virtual environment?

If you have the helper commands on your PATH you can use:

mycroft-pip install google-cloud-speech
1 Like

Thank you for your feedback. I tried it, unfortunately it does not help. I used the demo python script from google and it works that way. So I probably change some code in the mycroft scripts to send the text to be spoken to my own python file for replay. Do you have a link or file within the mycroft code where I best take the output text from to send it to my python file? Or where I might modify the mycroft code to work with google cloud text to speech?

If outhers can use it, here 2 links to get it working:

https://cloud.google.com/text-to-speech/docs/quickstart-protocol?hl=de

https://cloud.google.com/text-to-speech/docs/reference/libraries#client-libraries-install-python

Each of the STT engines has a class defined at mycroft-core/mycroft/stt

So you could hack your mycroft-core to send it to your other script instead.

We will have to investigate further why this isn’t working though.

Ok, thank you! I don’t have too much time at the moment, will go on as soon as possible.

This would be fantastic to see working, the option to use WaveNet voices would be a big step up in user experience.

Could the TTS section of the example mycroft.conf file at

Be updated to include examples for using Google Cloud Voice? Thanks!

Hey jonny07, did you got success on your Google-Cloud-STT project? I’m looking for a solution to use Google-Cloud-TTS. I think it works in a similar way.

I don’t see a workable solution OOTB. A few years prior it was supported - even through Selene (there’s a vid on youtube). But the codebase changed quite a bit. So i would expect a Google Cloud TTS plugin like this one will be mandatory

I just started looking at using Mycroft instead of my Echos. One thing that’s holding me back is the TTS engine. Last night I was able to set up Tasker on my Android phone to use Google Wavenet and I’m quite happy with the way it sounds.
From what I’m understanding here, this isn’t possible with Mycroft? In Tasker all I had to do was open a Google Cloud project, enter payment info and generate an API token. Then it was as simple as punching in the API token into Tasker.
I won’t be billed as long as I stay under 1,000,000 characters per month, which would be as if I were having it speak something like one sentence every 3 minutes of every waking hour, every day. Pretty unlikely in my scenario.
My search here hasn’t yielded any solid results, though I’ve seen some other TTS engines mentioned. Has anyone managed to get Wavenet working?
Thanks in advance!

@Quixote
Not with Mycroft. In a standalone Python script or with bash commands it works fine

I see. Any particular reason behind that? It seemed pretty simple to implement it in Tasker (though truthfully I’m not a developer so I have no idea how difficult it was for the actual programming of the feature).
I think it’s one of those things that seems like a small detail, but makes a huge difference. I aim to have whole home audio with my voice assistant wired up to that system, but there’s no way I’m doing that if it sounds like a “Speak & Spell”.

I just managed to get a wavenet google cloud TTS voice working. It’s some manual way though, not the official plugin way (yet). In short, I have applied a rejected PR on my local installation.

1 Like