You are not logged in.
Pages: 1
I am using dunst for notifications, and to get a alert, I use paplay to play a sound from a bash script
Problem is that when you are playing another media at high volume, notif sound gets completely lost in it. I don't want to set it too high because often I switch between bluetooth speaker and headphone and getting a alert sound at high volume in later is painful.
Is there a way to dim sound levels from other sources before playing notification sound and restore them immediately/slowly after ?
Last edited by jerryDaBaaws (2021-04-03 11:40:59)
Offline
Pulseaudio has module-role-ducking for this purpose, however that relies on the media.role property to be set which it might not be depending on the clients you are using and I don't find anything on how that would be enabled globally. going through the source I might've found something for the no role case but there's still not a just apply to all case but that should cover most of what you will encounter.
It should be trivial enough to set a unique trigger role for your paplay invocation, so your ducking line would look something like
#Should cover most, but you could just add roles to the list if you encounter more, I don't think there's a "everything" wildcard
load-module module-role-ducking trigger_roles=notification ducking_roles=no_role,music,video,audio volume=-20dBand the relevant paplay invocation
paplay --property=media.role=notification $FILEOffline
thanks, this works exactly as I wanted
Offline
Pages: 1