openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[pulseaudio] PulseAudio Binding Plays Back TTS at Insane Speeds #11662

Closed Dracrius closed 2 years ago

Dracrius commented 2 years ago

Expected Behavior

To play my TTS test message at a normal speaking speed like it does when using the chromecast sink.

Current Behavior

When using a PulseAudio Sink as a openhad sink the audio clip is played back at something like 8x speed as even reducing the speed by 1/4 is not understandable.

Possible Solution

Find what is causing the audio to be sent at an odd rate.

Steps to Reproduce (for Bugs)

Install Google Cloud TTS Install Pulseaudio Binding Setup Pulseaudio on a windows 10 machine using load-module module-cli-protocol-tcp Add Bridge and then sink through openhab UI Enable Create an Audio Sink with simple-protocol-tcp Set Audio source to new sink Go to Rules and Open Test TTS Rule and hit play Listen to instant play back of unrecognizable speaking. Set Audio source to chromecast Run rule again and here it quite clearly as normal speech

Context

If you look up Pulseaudio playing fast you only get issues from arch linux that suggest disabling the time base scheduling but doing so changes nothing. Reaching out to their community I get a "it's openhabs fault" basically and I can't find a way to test cli without openhab to verify.

Your Environment

openHAB3 and current stable PulseAudio Binding zulu Java 11 Windows 10

I am using this version of pulseaudio for windows as it is active (https://pgaskin.net/pulseaudio-win32/) but I got the same playback speed issue with (https://www.freedesktop.org/wiki/Software/PulseAudio/Ports/Windows/Support/) the version on the official site that appears to be more or less untouched since 2013.

Dracrius commented 2 years ago

Solved with this pull request https://github.com/openhab/openhab-addons/pull/11631 Same cause as https://github.com/openhab/openhab-addons/issues/11630

lolodomo commented 2 years ago

Closed by #11631