I am trying to get the googletts bundle working. On my first try, I have been redirected to the google /sorry/ page, so I tried the new URL “client=openhab”-parameter mentioned in this post.
It seems to work now, since I can’t see the redirect anymore. However, there is still an error which I can’t explain:
[WARN ] [.i.m.i.tts.TTSServiceGoogleTTS] - Error while connecting to Google translate service
java.io.IOException: Server returned HTTP response code: 503 for URL: http://translate.google.com/translate_tts?tl=de&q=Test&client=openHAB
Opening the URL in the browser works fine. I am using a raspberry pi 2 and I got the speaker connected via audio cable. Openhab is installed in Version 1.7.1 and the system is up to date.
Any ideas on this?
I’m seeing the same behavior. Have not confirmed this is absolutely true, but if I disable the service for a day or so, the error goes away for 10-20 more TTS commands…
This is due to the fact that google is blocking automated request on their servers for TTS.
I get the same issue as you and I’m a little bit stuck and don’t know what TTS to use. I tried Mary but there is no french support into the binding.
A good news, I found a service that can substitue the google one : http://www.voicerss.org/api/ as this service is returning a voice file by calling an url with some parameters it has the same behaviour as the google tts. Here is the parameters that worked for me:
1- create your API key by registering to the site
2-enter the following parameters into your openhab.cfg
googletts:translateUrl=https://api.voicerss.org/?key=YOUR API KEY HERE&hl=%s&src=%s
Don’t forget to have the google TTS binding installed
This is a great find @1technophile - I am going to update the Squeezebox action binding to allow the option to use this service since the Google TTS service is next to useless these days.
Thanks for sharing!!
Thats great news Ben! I have been waiting for the Squeezebox action to get fixed again. Can it be set to have a line in the openhab.cfg file, something like squeeze:speak.url=https://api.voicerss.org/?key=XXXXXXXXXX&hl=%s&src=%s
so that the actions binding doesn’t need to be fixed whenever a TTS service quits working.
Yep - that is exactly how I intend to implement it. I have got a test version running now which I will test for a few days before submitting a PR for this change.
do you have any news for us?
I haven’t got much time at the moment unfortunately. I have knocked up a temp version of the Squeezebox action binding using the new VoiceRSS service and it is working pretty good.
It is not as quick as Google was with generating the translations, so there is a delay of a second or two, but the voice is reasonably natural sounding and it seems to be handling the simple cases I am throwing at it.
I am away this weekend again but hopefully should have something ready for committing in a week or so. Apologies for the delay, life has gotten very busy all of a sudden!
no problem, thanks for your work!
also looking forward to be able to configure the TTS URL in the binding … I’ve also looked into alternatives to be less dependent on 3rd party services like google TTS (or any other). Also did some of the users mention they do not like to transmit data to the web for text to speech.
After some experiments with scripts I ended up writing a small M$-Windows REST service that can generate an mp3 from an Url (Prototape available here: https://dl.dropboxusercontent.com/u/1781347/RESTTTS.zip).
It’s in an early stage and only works on windows …
Once we can configure the URL in the binding I’ll give it a test with the squeezebox action - currently I only experimented with the browser (http://127.0.0.1:8089/Service/TTS?text=).
with kind regards,
Thanks for this work Ben.
I agree it would be nice to move away from cloud services that may change or stop.
FYI the asterisk and and anki crowd implemented some new changes to their googletts calls that seem to work (for the moment).
voicerss seems to be gone…
@Nicola_Reina This looks pretty interesting. to my mind having a local TTS engine seems like a good idea.
Do you have any details of how you handled the integration with Openhab. i.e. did you somehow configure it to read urls and return a wav like the google TTS service, or did you do it some other way.
BTW I Stumbled across some info about installing on Jessie and that these packages are now available:
if you add the following to your sources.list:
deb http://ftp.de.debian.org/debian jessie main non-free
you can apt-get them, seems to work ok.
I completely agree - a local TTS service makes a lot more sense. VoiceRSS is working ok in my test setup (sorry it is a very busy time of year I haven’t had a chance to code it up properly yet) but the delay is noticeable, especially when announcing long sentences that have to handled in two requests (VoiceRSS only allows up to 100 chars per request).
I am going to look into a ttspico and see if I can get that working. Would love to be free of these online services!
Hi I installed it locally using the instructions at the link .
I have not yet integrated it but in the end it could just be a matter of using exec binding…
I mean you do not have to have any wav file you just pass the sentence to speak to the command and… it speaks
I spent some time today playing around with
pico2wave and building a simple PHP script to replicate what the Google TTS service does. Had some reasonable success, instructions below.
You should be able to run this on a local server (using apache or the like) and then point your Google TTS binding to this URL. It expects two parameters in the URL - language (e.g. en-GB) and message to translate.
- install the necessary dependencies (pico2wave, lame)
- sudo apt-get install libttspico0 libttspico-utils libttspico-dev libttspico-data lame
- install PHP composer (needed to install/use phplame)
- copy the two files attached here to a folder under /var/www
- e.g. /var/www/tts
- ensure your web server has sufficient permissions to create files in this directory (e.g. owned by www-data)
- run composer to resolve the necessary dependencies
- setup your web server to allow requests to /var/www/tts
- beyond the scope of these instructions
- test by typing in the following to your browser;
I am using this in my hacked Squeezebox speak action (which I have hardcoded to call this URL) and it is nice and quick and the GB voice is quite fluid and sounds really good IMO.
Let me know if this helps!
tts.pdf (810 Bytes)
This file is actually a ZIP, so rename the extension to .zip and extract the two files to your