OH3 - Google TTS - Only white noise

It seems that the google sound files come in two formats wav or mp3. The wav files work well, the mp3 files don’t. Perhaps it is possible to explicitly ask in the ssml request to return a wav formated file?

1 Like

I upgraded to 3.1.0 snapshot, but it didn’t solve. first no problem. Have a black screen as main UI so cleared cache and restarted openhab, again the white noise…

1 Like

Want to bump this again. Just upgraded to 3.0.1 version and this still sometimes happens.

Also, completely rebooting the pi doesn’t work either every time.

Does anyone know how to investigate or solve this?

1 Like

I ran into the same problem now. I had to restart openhab (not the pi) and suddenly only white noise instead of voice. Sounds are played fine…
I’m on 3.1M2, so there’s no fix in there!

3 Likes

Any idea’s how to get the voice back? I have a sort-of sollution, most times when I stop openhab service, clean cache (openhab-cli clean-cache) and start openhab the problem is gone. But not always. I have no idea how to get the voice back without restarting the service / clean cache.

But this is annoying as it takes a while for openhab to start and I have to test everytime if the voice works after restarting. So restarting the openhab service is a pain in the ass with openhab 3 for me :frowning: That’s why i hope there is a way to reset the voice engine.

2 Likes
1 Like

Many thanks for the useful insights above that may explain a hitherto mysterious (to me) problem. It may be another consequence of the ill-defined audio formats of the Google TTS and Amazon TTS files:

I use the pulseaudio 3.1.0 binding on OH3 to route sound to a (remote) pulseaudio server, which then plays it via bluetooth. It works perfectly well when using standard MP3 files.

When I use TTS, however, MP3s get produced and do get played, but badly distorted. It sounds like they are sped up many times. Same happens when I play the TTS MP3 from the cache directly. Interesting in defense of openhab: the cached MP3s are garbled even when played by aplay on the pulseaudio server unless you explicitly define the format.

Does anyone know a way to specifically request an MP3 in “standard” encoding (44.1 kHz etc) from Google/Amazon via the Voice plugin? This is mentioned in the github discussion but not explained.
Or better: is there a way to correctly label the audio object in OH3? Many thanks!

2 Likes

After upgrading to OH3.1 the problem still persists in openhab. I was hoping there would be a fix but there isn’t.

Hope someone has an idea how to fix this. It’s a pretty large problem for me as restarting openhab always involves cleaning cache and starting a couple of times to get the voice working again.

2 Likes

Hello,

Same problem here.
Openhab 3.1.0 Google TTS and a raspberry pi 3 pulseaudio server.
MP3 files stored in cache are good and can be played manually.
But when they are played after text to speech, I just hear “pouic” !

Is there any news ?

Edit : I’ve just tried with voicerss and It works better but sound are played at 2X speed ! So same problem.

hi,

My issue was the same that in this topic :slight_smile:

It has been solved and integrated in openhab 3.2

https://github.com/openhab/openhab-addons/pull/11631

I updated my openhab to version 3.2 just an hour ago and the white noise problem still exists. Did not try anything fancy but just booted the new version, changed voice to google TTS and executed openhab:voice say h via Karaf and it gave a white noise.

Sad it still isn’t fixed. On the other hand, voice rss with the voice Bram for Dutch is good. Not as excelent as google but it’s something, at least the bitrate/sound quality is the same as google TTS.

Hello,

It seems there are several different issues on this topic, depending on the output method.
Could you please clarify which audio sink you use ?

If (and only if) it is an audio sink with the pulseaudio binding, I could try to reproduce and fix it.
Could you share your file, as generated by google TTS ? (It should be cached in this directory : /cache/org.openhab.voice.googletts")

Otherwise, if you use the javasound sink, I cannot help you.
(you can, however, use the pulseaudio binding if your openHAB system is on linux, even locally, but it seems a bit overkill to use a binding to output sound on the same computer…)

I use the system speaker in settings. Not sure if it is Javasound or pulseaudio. My receiver is connected to the 3.5mm jack on the raspberry pi.

I don’t know the pulseaudio binding, but if it works, it sounds like a sollution. Feels like overkill but if it works, it works :slight_smile:

Here is a file with the output, it sounds just fine playing it on my computer:

https://drive.google.com/file/d/1D4eGgyWvnEgtbYz11962y8egJjZhNJW_/view?usp=sharing

(you will hear the letter H in Dutch by the way)

Your WAV sound file is indeed in a format not well played by openHAB on system speaker.
I think I can pinpoint a bug in the core openHAB audio bundle, in the way WAV file are parsed and then played.
For those interested in the technical, I explain it in the github issue. It could be the root cause, but I’m not completely sure.
EDIT : not at all, it is in fact another unrelated bug

As I said earlier, I suppose you could, (as a workaround for those who has pulseaudio installed on the openHAB server), use the pulseaudio binding and define a pulseaudio audio sink.

Another way of fixing this issue would be to force the google TTS to output MP3. I will try to check if it is possible.

I made a DIRTY workaround in the google TTS service by forcing it to use the MP3 format. As I was not able to reproduce the original issue, I’m not 100% confident.
The snapshot is here, for 3.3 but should work on 3.2 and 3.1
Uninstall the binding from the openHAB interface before adding the “dirty patched one” to your addon directory (not sure it is needed but it could not do wrong)
You have to clean cache to be sure sound is regenerated.

This is NOT a durable solution. (And it is dirty, as I just force MP3 and thus reduce functionnality, because the binding is not capable anymore of choosing a format adjusted to the audio sink)

EDIT : forget this, I made a definitive fix three posts down.

1 Like

I will try this as soon as i have some spare time. thnx for the “sollution”.

Just curious, why would one use the WAV output instead of MP3? The sound quality difference between WAV and MP3 isn’t that much of deal for voice I guess.

openHAB is very flexible and you can use many different audio sinks. openHAB can send sound to a sonos system, a squeezebox, a pulseaudio server on the network…
These audio sinks have different capabilities, and it is possible that some of them don’t support MP3. This is why the TTS services should be able to produce as many formats as possible.

1 Like

In fact, by trying to fix a “near” bug in core openhab audio module, I realized that I can use my work for the google tts addon and I just opened a pull request to fix the root issue (which is that the wav file returned by google could be in another format than the one requested)

[EDIT : snapshot link deleted because a new one is available, see below]

I installed the new binding and it works
but with a problem. The audio/voice starts with a click noise. It isn’t in the produced wave file when i play it on my laptop.

The click noise problem has been solved after clearing openhab cache and restart (i already cleared google tts cache without result).

Thnx!

You are right, there is definitely a click at the beginning. I thought it was a glitch of my dev environnement…
Are you sure that your click noise problem has been solved ?
My guess is that with the restart, your Google TTS binding switched to MP3.
But, at the next restart, it could switch back to WAV…

But, good news, I found the source of the “click”. It was another bug, completely unrelated, but equally annoying (other part of openHAB seems to be affected and I will have to make some pull requests)
I made a new release (hopefully the last one).

1 Like