# GoogleTTS responding with 503 error (even after the URL fix)

**URL:** <https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385>\
**Category:** Text-to-Speech\
**Tags:** googletts\
**Created:** [October 16, 2015, 9:37am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385 "2015-10-16T09:37:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrelung](https://community.openhab.org/user_avatar/community.openhab.org/andrelung/32/71015_2.png) [@andrelung](https://community.openhab.org/u/andrelung)\
**Post date:** [October 16, 2015, 9:37am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/1 "2015-10-16T09:37:34Z")

</div>

Hi,

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.

> **[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/openhab/Sb8CuHDDCBk)**

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?

---

<div class="post-metadata">

**Author:** ![joe\_barneson](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@joe\_barneson](https://community.openhab.org/u/joe_barneson)\
**Post date:** [October 23, 2015, 1:03am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/2 "2015-10-23T01:03:03Z")

</div>

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..

---

<div class="post-metadata">

**Author:** ![1technophile](https://community.openhab.org/user_avatar/community.openhab.org/1technophile/32/98159_2.png) [@1technophile](https://community.openhab.org/u/1technophile)\
**Post date:** [October 29, 2015, 5:22pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/3 "2015-10-29T17:22:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![1technophile](https://community.openhab.org/user_avatar/community.openhab.org/1technophile/32/98159_2.png) [@1technophile](https://community.openhab.org/u/1technophile)\
**Post date:** [October 29, 2015, 5:40pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/4 "2015-10-29T17:40:35Z")

</div>

A good news, I found a service that can substitue the google one : [Voice RSS - Text-to-speech (TTS) API documentation](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:language=fr-fr  
googletts:translateUrl=[https://api.voicerss.org/?key=YOUR](https://api.voicerss.org/?key=YOUR) API KEY HERE&hl=%s&src=%s  
3- enjoy 😄

Don’t forget to have the google TTS binding installed

---

<div class="post-metadata">

**Author:** ![ben\_jones12](https://community.openhab.org/user_avatar/community.openhab.org/ben_jones12/32/52_2.png) [@ben\_jones12](https://community.openhab.org/u/ben_jones12)\
**Post date:** [November 15, 2015, 8:35am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/5 "2015-11-15T08:35:32Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![1technophile](https://community.openhab.org/user_avatar/community.openhab.org/1technophile/32/98159_2.png) [@1technophile](https://community.openhab.org/u/1technophile)\
**Post date:** [November 15, 2015, 12:51pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/6 "2015-11-15T12:51:44Z")

</div>

With pleasure !

---

<div class="post-metadata">

**Author:** ![kmac2001](https://community.openhab.org/letter_avatar_proxy/v4/letter/k/b9e5f3/32.png) [@kmac2001](https://community.openhab.org/u/kmac2001)\
**Post date:** [November 15, 2015, 3:33pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/7 "2015-11-15T15:33:11Z")

</div>

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](https://api.voicerss.org/?key=XXXXXXXXXX&hl=%25s&src=%25s)  
so that the actions binding doesn’t need to be fixed whenever a TTS service quits working.

---

<div class="post-metadata">

**Author:** ![ben\_jones12](https://community.openhab.org/user_avatar/community.openhab.org/ben_jones12/32/52_2.png) [@ben\_jones12](https://community.openhab.org/u/ben_jones12)\
**Post date:** [November 15, 2015, 9:20pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/8 "2015-11-15T21:20:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![haltmann](https://community.openhab.org/user_avatar/community.openhab.org/haltmann/32/13280_2.png) [@haltmann](https://community.openhab.org/u/haltmann)\
**Post date:** [November 19, 2015, 10:11am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/9 "2015-11-19T10:11:18Z")

</div>

Hello Ben,

do you have any news for us?

---

<div class="post-metadata">

**Author:** ![ben\_jones12](https://community.openhab.org/user_avatar/community.openhab.org/ben_jones12/32/52_2.png) [@ben\_jones12](https://community.openhab.org/u/ben_jones12)\
**Post date:** [November 19, 2015, 10:19am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/10 "2015-11-19T10:19:01Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![haltmann](https://community.openhab.org/user_avatar/community.openhab.org/haltmann/32/13280_2.png) [@haltmann](https://community.openhab.org/u/haltmann)\
**Post date:** [November 19, 2015, 10:21am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/11 "2015-11-19T10:21:20Z")

</div>

Hallo Ben,

no problem, thanks for your work!

---

<div class="post-metadata">

**Author:** ![patrik\_gfeller](https://community.openhab.org/user_avatar/community.openhab.org/patrik_gfeller/32/118631_2.png) [@patrik\_gfeller](https://community.openhab.org/u/patrik_gfeller)\
**Post date:** [November 21, 2015, 5:12pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/12 "2015-11-21T17:12:19Z")

</div>

Hi all,

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](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=](http://127.0.0.1:8089/Service/TTS?text=)).

with kind regards,  
Patrik

---

<div class="post-metadata">

**Author:** ![g\_g\_rich](https://community.openhab.org/letter_avatar_proxy/v4/letter/g/e95f7d/32.png) [@g\_g\_rich](https://community.openhab.org/u/g_g_rich)\
**Post date:** [November 23, 2015, 3:31pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/13 "2015-11-23T15:31:46Z")

</div>

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).  
([asterisk-googletts/googletts.agi at master · zaf/asterisk-googletts · GitHub](https://github.com/zaf/asterisk-googletts/blob/master/googletts.agi))  
([https://github.com/AwesomeTTS/AwesomeTTS/blob/develop/addon/awesometts/service/google.py](https://github.com/AwesomeTTS/AwesomeTTS/blob/develop/addon/awesometts/service/google.py))

---

<div class="post-metadata">

**Author:** ![Nicola\_Reina](https://community.openhab.org/user_avatar/community.openhab.org/nicola_reina/32/70903_2.png) [@Nicola\_Reina](https://community.openhab.org/u/Nicola_Reina)\
**Post date:** [December 6, 2015, 12:13pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/14 "2015-12-06T12:13:22Z")

</div>

voicerss seems to be gone…

---

<div class="post-metadata">

**Author:** ![Nicola\_Reina](https://community.openhab.org/user_avatar/community.openhab.org/nicola_reina/32/70903_2.png) [@Nicola\_Reina](https://community.openhab.org/u/Nicola_Reina)\
**Post date:** [December 6, 2015, 2:16pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/15 "2015-12-06T14:16:45Z")

</div>

as an alternative, i managed to install picotts locally using this instructions.

> **[Speak, friend, and enter – Speech synthesis with eSpeak and SVOX-pico for the...](https://blog.robotnet.de/2014/03/25/speak-friend-and-enter-speech-synthesis-with-espeak-and-svox-pico-for-the-raspberry-pi/)**

seems ok.

---

<div class="post-metadata">

**Author:** ![sam1](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@sam1](https://community.openhab.org/u/sam1)\
**Post date:** [December 7, 2015, 7:05am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/16 "2015-12-07T07:05:30Z")

</div>

@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:

> **[Client Challenge](https://packages.debian.org/jessie/all/libttspico-data/download)**

> **[Client Challenge](https://packages.debian.org/jessie/armhf/libttspico0/download)**

> **[Client Challenge](https://packages.debian.org/jessie/armhf/libttspico-utils/download)**

if you add the following to your sources.list:  
deb [Index of /debian](http://ftp.de.debian.org/debian) jessie main non-free

you can apt-get them, seems to work ok.

---

<div class="post-metadata">

**Author:** ![ben\_jones12](https://community.openhab.org/user_avatar/community.openhab.org/ben_jones12/32/52_2.png) [@ben\_jones12](https://community.openhab.org/u/ben_jones12)\
**Post date:** [December 7, 2015, 8:28am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/17 "2015-12-07T08:28:03Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Nicola\_Reina](https://community.openhab.org/user_avatar/community.openhab.org/nicola_reina/32/70903_2.png) [@Nicola\_Reina](https://community.openhab.org/u/Nicola_Reina)\
**Post date:** [December 8, 2015, 5:31pm UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/18 "2015-12-08T17:31:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ben\_jones12](https://community.openhab.org/user_avatar/community.openhab.org/ben_jones12/32/52_2.png) [@ben\_jones12](https://community.openhab.org/u/ben_jones12)\
**Post date:** [December 22, 2015, 5:02am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/19 "2015-12-22T05:02:00Z")

</div>

Hey guys,

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.

Installation

- 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)
  - curl -sS [https://getcomposer.org/installer](https://getcomposer.org/installer) | sudo php – --install-dir=/usr/local/bin --filename=composer
  - see [Introduction - Composer](https://getcomposer.org/doc/00-intro.md) for more details

- 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
  - sudo composer install

- 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;
  - [http://host/tts/tts.php?lng=en-GB&msg=Hello](http://host/tts/tts.php?lng=en-GB&msg=Hello)

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!  
Ben

---

<div class="post-metadata">

**Author:** ![ben\_jones12](https://community.openhab.org/user_avatar/community.openhab.org/ben_jones12/32/52_2.png) [@ben\_jones12](https://community.openhab.org/u/ben_jones12)\
**Post date:** [December 22, 2015, 5:03am UTC](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385/20 "2015-12-22T05:03:02Z")

</div>

[tts.pdf](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/1/182741d9bf6e096697bdc1748dbfd4ea4ac890bd.pdf) (810 Bytes)

This file is actually a ZIP, so rename the extension to .zip and extract the two files to your `/var/www/tts` folder.

[Next page](https://community.openhab.org/t/googletts-responding-with-503-error-even-after-the-url-fix/3385.md?page=2)
