Cannot play some mp3 on speaker attached to computer

  • Platform information:
    • Hardware: x86_64
    • OS: openSUSE tumbleweed
    • Java Runtime Environment: openjdk 17
    • openHAB version: openHAB 4.3.5

Hi all,

I have trouble getting text-to-speech with Amazon Polly to work. The mp3 file is generated but there is no output from the speaker attached to the computer.

After some tests I have found that I have audio output when I play doorbell.mp3 in the console, whereas with barking.mp3 I cannot hear anything. I suspect that this might help solving the issue with TTS.
Outside the console, I can play both file using (as root) runuser -u openhab – mpg123 .

I am wondering if it might be a missing java library. How can I further investigate and try to find a fix ?

Thanks

The only difference I recall between those 2 files was audio bit rate doorbell is 128k and barking was 64k

According to ffprobe, doorbell.mp3 is 128k stereo while barking.mp3 is 64k mono.
I tried azul openjdk17 with not much success.
Still investigating

Raspberries are mono output capable only, and so are some x86 boards and their Linux devices.
In the end, it’s about fiddling with the audio device options but barely worth the time.

Still working on my issue with mono mp3 files (like barking.mp3) which is still present with version 5.0.1.

To try to understand what part of the code manages audio output I completely deleted the org.openhab.core.audio jar file (and its parent folder) from /usr/share/openhab/runtime/system yet I can still play mp3 files from the openhab console.

Does anyone know how playing audio file is handled internally ?

it’s a Java functionality you directly call from rules DSL or JS