I am running Openhab 4.1 in Ubuntu (latest version) in an intel i5 desktop
I have set the system speakers as the default sound sink
If I reboot the computer I can get Openhab to play mp3 files placed in the sounds folder for some time with the playsound command in a DSL script. The command is just playsound(“name of file”), then it just stops working. I can go into the sounds folder and double click on the files and the computer will play them.
I also have another sound sink that I reference in the playsound command, that sink keeps working even when the system speaker stops, that command is playsound(“sink name”, “file name”).
Has anyone ran into this problem and been able to solve it?
I also noticed that the volume option for the playsound command does not work, but that is not a big issue.
I sporadically have problems with playing sound files located in /etc/openhab/sounds. In some openhab releases, it works fine; in others, it fails (no log messages that I can find). I just installed openhab 5.2.1 and it’s not working anymore (was previously working under 5.1.3.
Unlike you, I’m not using it in a DSL script, but rather, via a javascript script which runs from an automated trigger (or manually when I click the Run icon). I have no idea what’s wrong. The files exist, they are readable (permissions wise), etc.
My post is from a while back, I really cannot remember how the problem got solved maybe it was when I upgraded Ubuntu to 24.04, I am now on Openhab 5.1.3 using Javascript for my rules and I have not had a problem with sounds in a while.
No worries, thanks for checking in! I restarted OH, even though it’s only been up 2 days (since I upgraded from 5.1.3 to 5.2.1), and it started working. So maybe the “first boot” of a new version causes it to not find the files? Or maybe there’s some other race condition involved. I’m not likely to pursue it any further.