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

Hey @hazymat - yeah I don’t tend to use synchronisation very much. I have a Squeezebox Boom in the kitchen which is what I use primarily for all my announcements. Occasionally I will play it on all devices if it is serious enough!

You might need to wrap your announcements in a rule which un-syncs before speaking, and then re-syncing?

FYI - I just updated the WIKI with a small change to the tts.php script, to include a couple of additional header attributes, the most important one being the bitrate. This is so clients can calculate the length of the stream (by looking at the file length and bitrate). I was finding when playing announcements on my piCorePlayers (RPi based Squeezelite clients) they were playing the stream as if it was endless, and didn’t actually play the announcement at all.

Not sure why these Squeezelite based players are different to hardware based players, like the Boom which seems to work fine without these extra attributes, but it doesn’t seem to hurt and now my piCorePlayer clients are working as well.

Hi,
@patrik_gfeller Thanks for Your great job.
You code work great, when I open URL in chrome, but when I send it by openhab to squeezebox, then I can see correct URL on Squeezebox radio LCD, but don’t listen anything :frowning:
What I’m doing wrong? I change openhab.cfg like You show in post above. Sorry for my english.

rule “Test”
when
Item Test received command
then
squeezeboxSpeak(“bathroom”, “Say something”)
end

Hi Fro,

thanks for your feedback. Can you please post your “RESTTTS.exe.config” and the relevant part of your openHAB configuration file?

Things to check: in both configuration files; openHAB and RESTTTS have the same IP configured; loopback address (starting with 127.x.x.x) will NOT work. Was the chrome browser on a different machine, or on the same one where RESTTTS is started? Try if chrome works from another computer. If not, you may need to configure the firewall to allow communication to the port configured in RESTTTS.

What squeezebox player type do you use - maybe it is also a problem with the headers (related to @ben_jones12’s finding).

with kind regards,
Patrik

@patrik_gfeller : My settings

################################## Squeezebox Binding #################################

squeeze:server.host=192.168.1.100
squeeze:server.cliport=9090
squeeze:server.webport=9000
squeeze:bathroom.id=(here MAC from my squeezebox)
squeeze:ttsurl = http://192.168.1.100:8089/Service/TTS?text=%s
squeeze:ttsmaxsentencelength = 4096

RESTTTS:

        <setting name="Host" serializeAs="String">
            <value>192.168.1.100</value>
        </setting>
        <setting name="Port" serializeAs="String">
            <value>8089</value>

Was the chrome browser on a different machine, or on the same one where RESTTTS is started?

  • when I wrote : was the same one where RESTTTS, now I try on different - don’t working :frowning:

If not, you may need to configure the firewall to allow communication to the port configured in RESTTTS.

  • To be clear - I don’t now how, but I’ll try find something :slight_smile:

What squeezebox player type do you use

  • For now I use Logitech Squeezebox Radio , also planning try Squeeze on RPI2

When I run rule in Openhab: Squeezebox turn on, and on LCD I see URL from config, but no any sound, after few seconds radio go to standby

Thanks for reply
Adam

@hazymat … had a quick look what balabolka does; it seems that two things are possible:

  • substitution of words (e.g. replace M$ with Microsoft) - .dic files
  • replace part of a strings, or word using regular expressions - .rex files

Technically I think both things (files) could be used to pre-process text prior to passing it to the TTS synthesizer.

I don’t know how many users do have a M$-Setup as we do … but I think next I’ll add a wiki on how to use this SW (e.g. firewall config) and a new topic in the forum to discuss requests & usage.

Big thanks to @ben_jones12 for the changes in the squeezebox binding that makes this possible in the first place :slight_smile:

Please do that ! :pray:

I’m trying to setup the Local TTS also and have the TTS working from a browser, but when activate a rule - squeezeboxSpeak(“ReadingRoomPlayer”, “Test switch ON”), the Sqeezebox Radio is showing - “http://translate.google.com/translate_tts?tl=en&q=Test%20switch%20ON0, Radio” on the display. I replaced all Sqeezebox bindings with the latest ones from cloudbees and checked the related elements at openhab.conf. What am I missing? Where is this url coming from?
Thank you all, for the great community effort on getting TTS to work locally.

What is your squeeze config in openhab.cfg'? You need set thettsurl` option with your TTS URL. The binding will default to the Google TTS URL if nothing is specified.

I have the following in openhab.cfg - squeeze:ttsurl=http://192.168.x.x/tts/tts.php?lng=en-GB&msg=%s
Rebooted the Pi, just in case, but still getting the same URL.

Then it sounds like you are not running the latest version of the Squeezebox binding (you need both the io and action bundles).

Sorry for the newbie question, but is just copying to the /addons directory enough? I got org.openhab.io.squeezeserver-1.8.0-SNAPSHOT.jar and org.openhab.action.squeezebox-1.8.0-SNAPSHOT.jar from cloudbees and copied to /addons, deleted the old ones and renamed the new ones to org.openhab.io.squeezeserver-1.7.1.jar etc.
.

Sounds ok to me - you don’t need to rename them, but definitely need to ensure there are no old versions lying around. Maybe grab the binding JAR as well? Sounds like it should be working - is your openhab.cfg definitely the one being picked up/loaded by openHAB?

I just deleted the existing ones and copied the new 1.8.0 ones again and is still coming up with the same google translate url. Will try to figure it out, may be there will be something in the logs. The openhab.cfg should be the one used by openHAB, but I’ll check if I have another one.

It works now :slight_smile: Found out that the “real” addons are in /usr/share/openhab/addons/ not /etc/openhab/addons/ as I thought.
I used apt-get to install the addons and I think this is what pointed openHAB to /usr/share/openhab/addons/.
Thank you, Ben for your help and your work on this issue (which I had the chance to experience, before replacing the bindings:))

Glad you got it sorted. Enjoy those TTS announcements…

Ben, are you using the windows service or the linux for your TTS? I am favoring the linux side since I only have 1 pc in my house and all my OH stuff is in my VM cluster on linux variants. Does the linux option support getting alternative voices? Or are we out of luck on that front?

I am using this on my Linux server. There is sorry for different languages, including US and UK English, but not for different voice modules as such, AFAIK.

Hey @ben_jones12

I’m having trouble time getting a piCorePlayer Raspberry Pi 1 Model B on wifi (either version 2.0 and 1.22) to play a local tts stream using your local tts service. When a rule triggers and runs the command squeezeboxSpeak(“corepiplayer”, “Hello this is a test”) the picoreplayer says the message “Adding TTS Announcement to Playlist” and I see the currently playing file is “TTS Announcement”, but I don’t hear it and sometimes it ends abruptly (1-2 seconds) and other times it stays as the currently playing media for 10-12 seconds. No matter the length of the tts.mp3, picoreplayer says its 1 second in length.

I tried serving the files/php with both lighttpd and apache hosted an a raspberry pi 2. The tts service works fine in a web browser and if I send the stream to a SqueezePlay player in windows. I tried both usb audio and analog and even sampled the tts mp3 to 44.1 and forced CBR 64 in case it was particular towards the sample rate of my DAC and a fixed bit rate rather than variable. Still the same result.

I am running OpenHAB 1.8 on a raspberry pi 2 (ethernet connected) where I’m also hosting the tts service. I included all of the headers you added to the wiki in the tts.php file, particularly the bitrate one. I’m using the tts.php exactly as it is in the latest wiki entry. Do you have any suggestions on what could be causing the issue using the squeezeboxSpeak action against a picoreplayer?

Thank you for any light you can shine on this.

Sorry, am away from home at the moment and will be for another week or so. It sounds very similar to the issue I was having initially, which was resolved by adding the bitrate header.

This is not my area of expertise sorry, I really had to fumble my way thru the PHP side of things. So unfortunately I don’t have any other suggestions!