New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[googletts] Only white noise #10015
Comments
Just a bump. Can I help in any kind of way to sort this problem. It really is a problem for me, so I want to help any way i can. But I don't know that to do anymore. :) |
The add-on stores the sound files generated by Googles TTS in a local folder. You can find them in the |
Yes, when I clear cache the folder is empty afterwards but still white noise. Strange thing now is. I can't get it to work anymore. I rebooted, clean cache, restarted openhab service, stopped the bundle via karaf, stopped all other voice related bundles, uninstalled it via add-ons.cfg. but it just gives noise, but only via the 3mm port, via Chromecast the voice works just normal. The sound files in the cache play just fine, so the whole "get Voice from Google"-part works. Just the playback via 3mm Jack gives noise. And only Google TTS. Other mp3's just work fine when Google TTs fails. |
Are you using "System Speaker" as a default audio sink? Do you have other audio sinks for testing available? Does it work with them? |
Yes, I meant "System speaker" when I said 3mm jack. I tested it with Chromecast audio sink and then it just works. No more noise, but when I change to System speaker i only hear noise. |
I have the slight feeling it is not related to Google TTS. But javasound. Can you enable DEBUG logging for |
I think you're right. I didn't know javasound could be the problem, so I only was able to focus on Google TTS.
|
Hmm, when i check the file it outputs it has these properties: 16bit,1 channel, 24000hz. But that's not what the log says. |
I think we got a track. My log is different - TTS service uses a different audio format (mp3):
When increasing logging to TRACE for googletts and restarting the bundle do you see something like this:
|
I'm not at home right now, but I'm sure I have this in my logs every time Google TTS is used: format not supported: OGG_OPUS For the other TRACE logs I have to check my system. Will do this evening. Looks like the system(javasound I guess) is playing the file in a wrong format. Funny thing is, you can hear the words kind of when noise is being played. (By the way, I'm also from Holland, and (het gaat goed) I'm doing fine haha. |
Here is my output with TRACE, no strange extra's when using voice (noise lol):
And below, same output as yours.
Get's me thinking, could there be anywhere a config file where the parameters could be set? Maybe there is somewhere a place where the output settings can change. Because the mp3's file frequency is 24000hz, but the log says: [codec=PCM_SIGNED, container=WAVE, bigEndian=true, bitDepth=16, bitRate=705600, frequency=44100]. Not sure if that's cosmetical or just wrong. [edit: nope, that's not the problem, when it's a config error, the problem should always exist. This problem, mostly exist, not always. How can we check Javasound?] |
Some extra info:
I set the log levels from above to TRACE via Karaf, but when playing, there are no errors. I don't think the problem is within the GoogleTTS binding. But I don't know where to look to check the Enhanced Javasound for errors or settings... By the way, i'm using a Raspberry Pi 4b. Maybe it's hardware related in some kind of way? |
All involved bundles (javasound, googletts, chromecast in my case and webaudio) are supporting both audio formats mp3 and wav whereas mp3 is the preferred one. I am not aware of any configuration setting to override the default values. Currently I do not have a clue where to look next. I do not think that it is a hardware problem. ftr. I am not from the Netherlands. 😉 Ik ben Duits (I am German). |
Me neither... Hopefully someone will find a solution for this after reading this thread. If I stumble upon something I will post it here but I'm out of options too. (Not many Germans speak Dutch. Nice to see our language 'across the borders' :D.) |
I'm pretty sure it's not a hardware problem either, I'm on a rpi3b+. |
With hardware I meant driver for certain Pi model but Nice to hear it isn't only the pi4 but also other models. So it had to do something with playback, but how and where it goes wrong... |
Also hit this and second restart fixed it. It seems whenever TTS uses .wav it does not work. If it uses mp3 it does work. I've started digging into code more. This is just dump of my process. I hope in the end I will find out what's wrong :). How does google-tts openhab service work?
GoogleTTSService creates the CONTAINER_WAVE like this:
The
What is the .wav produced by it?I've unfortunately removed the cache, but I have this is my terminal history. I have no reason to not believe
What does google API says for text.synthesize?https://cloud.google.com/text-to-speech/docs/reference/rest/v1/text/synthesize LINEAR16 | Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio content returned as LINEAR16 also contains a WAV header. It also seems that sampleRateHertz is by default set according to voice, which for my voice is 24000Hz. This is also what ConclusionI think there are issues in GoogleTTSService plugin when creating LINEAR16 audioformat in
Why does it sometimes work?My theory is that getBestMatch sometimes handles MP3 before WAV from This is quite possible, because MP3/WAV is defined in Set here: https://github.com/openhab/openhab-core/blob/ee1d3f3a73c728973e8bb374641615f42f1dc2f9/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/internal/javasound/JavaSoundAudioSink.java#L68 Reading some doc about Java sets, it seems |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/oh3-google-tts-only-white-noise/112714/22 |
I've just upgraded from 2.5.8 to 3.0.2 and am experiencing this issue on my Raspberry Pi 4. The generated WAV file in the cache folder play fine using aplay on the machine. |
I have the same issue. After several service restarts google TTS works normal. Hardware: AMD Ryzen 3200G System |
FYI, I've switched to voicerss openhab addon which works as expected for my use-cases. It supports lot of languages and does not have this issue. With google tts, I also had an issue when I had to add the token after few days to get it work. I suggest people to do the same. |
I didn't like voicerss because of the bad sound quality, it sounded as if the speaker was packed in a large blanket, a verry low sample/bit rate. But I checked again today and saw 2 new voices for dutch. I tried one of them and it sounds pretty good. Ok, wavenet from google is just better but this is good enough for me. I still hope someone can fix google TTS one day but for the time being VoiceRSS is fine for me. |
Voicerss looks and sounds good - I tried it via their website. Unfortunately after installing the binding it seems you can't change from the default voice :-( |
It's a bit off topic. But it's right, voicerss is at a high nitrate on their website. But you can change the voice in the settings of openhab. I did it yesterday. For Dutch there are 3 voices, 1 default, 1 female and 1 male voice. Only the male voice sounds clear for Dutch. I'm pretty sure for English there are more then 1 voices to choose from. |
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. |
Hello all. [DELETED] EDIT : the bug I mentioned is unrelated, as the method in the TTS service doesn't use the play file method. |
…#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
…#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
@hanzz was right in this analysis, and it seems that the solution is to parse the resulting audio file to get correct information before trying to play it. I opened a pull request with the fix. |
* [googletts] Use real sound returned to get play informations (#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close #10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* [googletts] Use real sound returned to get play informations (openhab#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com> Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
* [googletts] Use real sound returned to get play informations (openhab#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* [googletts] Use real sound returned to get play informations (openhab#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* [googletts] Use real sound returned to get play informations (openhab#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* [googletts] Use real sound returned to get play informations (openhab#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com> Signed-off-by: Nick Waterton <n.waterton@outlook.com>
* [googletts] Use real sound returned to get play informations (openhab#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
* [googletts] Use real sound returned to get play informations (openhab#10015) When google tts returns a wav file, it is now parsed to get correct informations about it.(mandatory for playing it with at least the System speaker audio sink) Close openhab#10015 * Fix a regression, as the WAV fix was incorrectly applied to the MP3 file Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Platform information:
Hardware: Raspberry Pi 4B 2GB
OS: Openhabian 1.6.2 64Bit
Java Runtime Environment: Java 11
openHAB version: 3.0.1 release build
When openhab service is stopped the voice played bij Google TTS service via 3.5mm jack output, i only hear white noise. Sometimes rebooting the raspberry pi solves the problem. Every time I restart the openhab service, this problem occurs again.
What I checked:
Not sure how to fix it.
***- At this very moment, I had to reboot the Pi > White noise >restarted openhab > white noise when 'saying' something... I cleared the cache with [openhab-cli clean-cache] >>> This solved the problem this time
The text was updated successfully, but these errors were encountered: