Openhab 2 Squeezebox Text to speech?

Hi, just came across this - as I’m new to openhab, is this change included in beta or the nightly builts? I’d like to give TTS a try…

Thank you!

It was merged yesterday, so it should be in today’s snapshot (nightly) build.

Let me know if you run into any issues.

I’ve set it up, but if I try smarthome:voice say Hello the command takes around 15 secs without any audible output.

The log says:

2017-02-17 19:16:14.472 [ItemStateChangedEvent ] - MobilLautsprecher_Control changed from PAUSE to PLAY
2017-02-17 19:16:14.785 [ItemStateChangedEvent ] - MobilLautsprecher_PlaylistIndex changed from 1 to 2
2017-02-17 19:16:44.303 [ItemStateChangedEvent ] - MobilLautsprecher_Volume changed from 27 to 0
2017-02-17 19:16:44.423 [ItemStateChangedEvent ] - MobilLautsprecher_Control changed from PLAY to PAUSE
2017-02-17 19:16:44.746 [ItemStateChangedEvent ] - MobilLautsprecher_PlaylistIndex changed from 2 to 1
2017-02-17 19:16:44.841 [ItemStateChangedEvent ] - MobilLautsprecher_Volume changed from 0 to 27

Is there any way to set the volume?

Also I got a log message like this:
2017-02-17 19:16:44.284 [WARN ] [ebox.handler.SqueezeBoxPlayerHandler] - TIMEOUT after 30000 waiting for stop!

@mhilbush any idea what’s wrong?

I’ve selected voicerss and one of the players as sink, chose a voice and set the api key in the voicerrs file.

What device are you using as a player? By any chance are you running squeezelite (or piCorePlayer, which uses squeezelite)?

The players use moode audio - it’s working normally outside of openhab. But yes, it uses squeezelite I think.
The version is 1.8.5 - which does not work as far as I read above? :frowning:

Yes, squeezelite versions after 1.7 have a defect that causes short duration MP3’s to fail. What you are seeing above is exactly the symptom of that problem.

There’s some discussion on this issue here.

I found a temporary workaround for the issue. Another forum member, @g_g_rich, was kind enough to build a version of squeezelite for piCorePlayer with the workaround for the issue until Ralphy can do a proper fix. Not sure if this would work for you (I don’t know much about moode audio).

You also could post a “me too” issue here, which may help with prioritizing a permanent fix.

Edit: Just read a little about moode audio – looks pretty nice. Perhaps you also could contact the moode audio developer to explain the issue you’re having with squeezelite. He might be able to help with a fix.

Just found this binding and it’s working perfectly. When the doorbell is activated, a rule plays a tune on our Squeezebox radios. It does take some time and sounds a bit funny, as it goes through them one-by-one. Maybe sync’ing them could be the answer.

Another question: It is possible for OH2 to react to the alarmclock going off on one of the radios? I’d like to stay with using the built-in alarmclock, but OH2 could then turn on the lights etc.

Thanks for the feedback. :thumbsup:

Yeah, I know. I’m not aware of a way to play the notifications concurrently on multiple players (other than creating a rule to sync the players, play the notification, and then unsync the players). Note that I haven’t done this yet myself, so I don’t know how well it will work. :sweat:

I’m not sure about this, but it’s a nice idea. I was going to take a look at implementing alarms, in general. I’ll keep this idea in mind. But I won’t be able to start looking at alarms for at least a few weeks.

No worries. I really appreciate all the work you’ve done (Even though the Squeezebox’es are EOL :sob:)

Thanks a lot for the explanation! That’s a pity!
I’ll have a look and try to push it :slight_smile:

@mhilbush I tried your audio sink enhancement with my squeezebox3 player, but unfortunately I get a error message on my squeezebox3 player.

openhab> smarthome:voice say Hello world!

The display of my squeezebox shows:
Error playlist is empt
This error message is translated from german and may therefore differ from known error message.

My logfile shows

sq_wohnen_title changed from La Muralla to http://192.168.yy.xx:8080/audio/3e57f5cd-59c5-4681-9c90-e4e294e87664.wav

which looks quite OK (replaced IP adrdress yy.xx). After a silence pause the squeezeplayer starts with a new song.
Do you have an idea, what goes wrong? It doesn’t play the doorbell.mp3 as well?

Any hint is appreciated.

PS: my default tts service is marytts:bits3hsmm bits3-hsmm - Deutsch

I’ve not seen that behavior before. The best thing would be to put the binding into debug mode, then post the log file entries.

From the karaf console, you would enter:

log:set DEBUG org.openhab.binding.squeezebox

To end debug mode, you would enter:

log:set INFO org.openhab.binding.squeezebox

My openhab.log

2017-03-26 19:35:15.851 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Processing audioStream of format AudioFormat [codec=PCM_SIGNED, container=WAVE, bigEndian=false, bitDepth=16, bitRate=256000, frequency=16000]
2017-03-26 19:35:15.857 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Play notification sound on player 00:04:20:06:21:aa at URI
2017-03-26 19:35:15.857 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Cur State: vol=50, mut=NOT MUTED, pwr=ON, stp=NOT STOPPED, ctl=PLAYING, shf=OFF, rpt=PLAYLIST, tix=5, tnm=47, tim=30
2017-03-26 19:35:15.858 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Setting up player for notification
2017-03-26 19:35:15.858 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Turning off repeat
2017-03-26 19:35:15.859 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa playlist repeat 0
2017-03-26 19:35:15.859 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa stop
2017-03-26 19:35:15.860 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa mixer volume 50
2017-03-26 19:35:17.963 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 2100 ms for volume to update
2017-03-26 19:35:17.964 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing notification
2017-03-26 19:35:17.964 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa playlist add
2017-03-26 19:35:18.365 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 400 ms for playlist to update
2017-03-26 19:35:18.365 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa playlist index 47
2017-03-26 19:35:48.389 [WARN ] [ebox.handler.SqueezeBoxPlayerHandler] - TIMEOUT after 30000 waiting for stop!
2017-03-26 19:35:48.389 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Restoring player state
2017-03-26 19:35:48.390 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa mixer volume 0
2017-03-26 19:35:48.490 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 100 ms for volume to update
2017-03-26 19:35:48.490 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa playlist delete 47
2017-03-26 19:35:53.495 [WARN ] [ebox.handler.SqueezeBoxPlayerHandler] - TIMEOUT after 5000 waiting for playlist to update!
2017-03-26 19:35:53.495 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Resuming last item playing
2017-03-26 19:35:53.495 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa playlist index 5
2017-03-26 19:35:54.397 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 900 ms for playlist to update
2017-03-26 19:35:54.397 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa time 30
2017-03-26 19:35:54.397 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing the playlist item
2017-03-26 19:35:54.398 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa mixer volume 50
2017-03-26 19:35:54.598 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting 200 ms for volume to update
2017-03-26 19:35:54.598 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Restoring repeat mode
2017-03-26 19:35:54.599 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 00:04:20:06:21:aa playlist repeat 2
2017-03-26 19:36:00.159 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: players 0

Where should I find this file
file? openhab2 runs as user openhab, Could this be a problem with file or folder permissions?

What player are you using? By any chance does it use squeezelite. For example, piCorePlayer uses squeezelite.

I think it’s in userdata/voicerss/cache

Duh. Nevermind. You said you were using MaryTTS…

Umm…I could not get marytts to work with my squeezeserver and i think it’s due to the fact it delivers a .wav file to the server which it can’t handle; voicerrs delivering a .mp3 works flawless.

Hmm. I thought LMS supported WAV files. But, I honestly have never tried to play a WAV using LMS.

1 Like

Well, I could try another tts service, but as mentioned above it does also not play doorbell.mp3

I only have the hardware squeezebox player, no squeezelite.

Well it supports it in general - it just needs to be set up. F.e. on mine (LMS running on Synolgy NAS) from the experience with marytts it is not set up. Somewhere deep down in the LMS config page i saw it’s missing lame…just thought I’s mention this befor you search an error in the binding while it’s serverside…