I can’t get canberra-gtk-play to play any sound files on XFCE.
When running “canberra-gtk-play -f [the name of the file]”, the command outputs nothing but the following error: “Failed to play sound: Sound disabled”.
I’ve searched a lot about it on the Internet but I couldn’t find the exact reason behind this error. How do I fix this?
P.S. The same command works on Linux Mint XFCE.
Any sound work???
Sound works, it’s just that this particular command refuses to work. The same issue was present on Leap 15.4
Done the switch to packman??? may be missing codec.
Yes. Packman is in the repos and codecs are installed.
Check
grep -i sound ~/.config/gtk-3.0/settings.ini
Is sound enabled?
The command outputs “gtk-enable-event-sounds = 1”.
I just remembered, I found this solution somewhere online but it didn’t work, unfortunately. There are no other strings other than [Settings] and this one in the document.
Ok, I had to install ‘canberra-gtk-play’ in order to test for myself (I’m using KDE Plasma Wayland, openSUSE Leap 15.5). I downloaded a sample .wav file and it played with no issue. FWIW, I’m using pipewire, and
wpctl status
shows the client running when playing the audio file as expected.
What is returned by zypper?
zypper se -s canberra
Problem fixed by installing pipewire-pulseaudio and replacing canberra-gtk-play with pw-play instead.
Thanks for the update. Not sure why you couldn’t get it working. FWIW, most are using pipewire these days, (and sometimes pipewire-pulse for compatibility reasons), which is also why I wanted to see the ‘wpctl status’ output.
The question is not clear to me. Was the op trying this for an event sound or just trying to play the sound from the /usr/share/sounds/…
Not sure either. I assumed they were interested in event sounds (although that utility can be used as a CLI audio player).
I was trying to play a sound event file using this command from CLI.
It worked on Debian-based distributions, not sure what went wrong here.
Yep, it is tricky some sound event play and some are not.
Some play by just inputting the sound file and some won’t and needs to type the full path to the sound file.
Here I am using the login event sound for plasma in xfce to have a bit of juice when I login. I added it in application auto start using canberra-gtk-play.