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

@hazymat Thanks - I’m glad that it is of use. As far as I know there are 3 differente API’s for TTS in Windows: SAPI 4, SAPI 5 and M$-Speech Platform. In the past I used commercial voices to listen to larger texts - at the time Cepstral was nice and far superior to the OS voice. With Win 10 the german default voice is decent enough for me - thus I do not installed it on the machine …

I do not know if a commercial voice is an option for you, or not. Some links to listen to them:
https://www.cereproc.com/storesapi, http://www.cepstral.com/en/personal

I’ll add code to the program that will list all installed voices and their language - together with an option to define the voice to be used in the configuration. Maybe there is already something on the system that’s better (you may use Balabolka ( http://portableapps.com/apps/accessibility/balabolka-portable ) to have a look what is already available. What you see there as SAPI 5 should be easy to be used.

Please let me know if none of the OS voices, and none of the commercial choices are an option for you; if there’s something for you I’ll go ahead and implement additional code to select a different SAPI 5 voice (of course only use trial versions until we have it fully working if you go commercial) …

kind regards, and a happy new year,
Patrik

@patrik_gfeller Happy new year to you too! There was a brilliant programme on the radio this morning (BBC Radio 4) presented by a German comedian called Henning Wehn about the subtleties of the English language compared with German. Is it possible that TTS voices suit the German language more than English, French, Spanish languages? The first ever decent English accent voice I heard was Siri UK, but the voices on Cereproc seem even better.

I have just purchased the “Lauren” voice, which is excellent and the most natural I’ve ever heard. Cepstral voices are not nearly as good in my opinion.

I’m running OH on Win Server 2012 but may migrate to Windows 10. Either way it’s nice to know Balabolka can be used as an alternative, and I like the option of substitution (e.g. if regularly used words in OH notifications sound funny).

Do let me know when you’ve added the option to list all installed voices, and the option to define the voice to be used in the configuration. I’d love to test this!

@hazymat

… did some work today; when you start this version it will list the voices it is able to see. The voice id used in the application configuration file to select the voice:

https://dl.dropboxusercontent.com/u/1781347/RESTTTS-2016-01-01.001.zip

Do you know in what format balabolka stores the substitution list; if it is not too complex I can maybe apply it as well to the incoming text.

But 1st things first … do you see Lauren in the list & does it work if you try to use it as synthesizer (application config file).

kind regards,
Patrik

@patrik_gfeller Just downloaded the updated version. Yes I see Lauren in the list and yes I can change the config file to change the voice. This is wonderful.

The substitution list for Balabolka is, I believe, called the “pronunciation rules”. I don’t fully understand how this works or where the list is stored. I’ll investigate further. But it does seem from the settings dialog that the rules can be applied to either sentences, paragraphs, or “combined method” - so that sounds like a complication to introduce to your REST service. (Possibly not a profitable one?)

Lastly, I know this is a basic question, but how do I download a build of @ben_jones12’s new action? I was hoping to simply pull out the changed files from GitHub and drop them into my build, and was looking for something like org.openhab.action.squeezebox-1.x.x.jar. Is that possible? I couldn’t find any .jar files in Ben’s pull request. I’m rather new to Java in general and have hacked my way through OpenHAB so far :stuck_out_tongue:

Has the PR been merged yet? If so, you should find the binding/addon in the nightly build at https://openhab.ci.cloudbees.com/job/openHAB/

@hazymat

I use the squeezebox add-on’s from couldbees (see post from @danielwalters86) the changes in the binding are merged already (I do not have Java IDE setup).

@ben_jones12 Quick question for you. Do you use Squeezebox’s own sync function to keep different zones in sync? If so, how do you cope with wanting to do the TTS speak only in a certain room? For example, I sync all my players, but when I run squeezeboxSpeak(“Bedroom”, “Bedroom lights set to reading mode”, 25), it plays (often very loudly) in the other room scaring the heck out of others in the house :smile:

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?