saivert / pwvucontrol

Pipewire Volume Control
GNU General Public License v3.0
272 stars 8 forks source link

Make noise when changing volume #36

Open burgerindividual opened 2 months ago

burgerindividual commented 2 months ago

One of the features I really like about pavucontrol is that it makes a noise when the volume is changed. I think it would be nice if this project also had that feature.

Prior to writing this issue, I did a little digging. The status quo (done by pavucontrol and Plasma PipeWire Applet) seems to be to use libcanberra, which is the only implementation of the XDG Sound Theme spec. Someone seems to be making rust bindings for libcanberra [here] (https://github.com/yuki0iq/canberra/), but it looks like it's WIP and isn't on crates.io. From there, the pulse backend could be used, as there doesn't seem to be a pipewire backend (Plasma PipeWire Applet does this).

I tried to implement this myself without looking at how other apps do it, and I found that it would be a major hassle without libcanberra, especially with playing sound through the PipeWire apis. The documentation isn't great and the examples are complex. Locating the volume change sound effect, decoding it, and playing it, all seem to be their own challenges. It would probably require pulling in gstreamer and maybe pulseaudio, which seems very overkill.

Dieterbe commented 2 months ago

i find that popping sound in pavucontrol a bit annoying.

saivert commented 2 months ago

I will not pull in the libcanberra dependency. You need a new mechanism to get the default system beep sound file from the desktop environment. This will most likely not be implemented any time soon. It would be enabled by a preference for sure since not everyone likes it.