Is there an app that can program audio configuration?
from QuazarOmega@lemy.lol to linux@lemmy.ml on 08 Sep 2024 10:55
https://lemy.lol/post/30887473

I sometimes play games and also open my music player, but the sound from the game drowns out the music, so I need to go into the sound mixer on KDE and manually lower the game’s volume every time.
I was wondering, is there a way to do this process automatically? As in setting up conditions like “if music is playing (some MPRIS API?) then lower all other apps’ volumes)”, maybe even crazier “if some app is outputting voice then set its volume back up and lower music app’s volume or pause its playback altogether for some specified timeout that keeps being refreshed for as long as voice is heard”.
I imagine the latter is a bit of a dream, but maybe for the first, even some quick sound profile selector would go a long way, say switching from “normal profile” to “background music profile”, etc. which specify preconfigured volumes for those apps.
Is that a thing?

#linux

threaded - newest

unlawfulbooger@lemmy.blahaj.zone on 08 Sep 2024 11:39 next collapse

The details depend a bit on the audiostack of your distro, but they all have a cli program with which you can change inputs/outputs and volume; e.g. pactl for pulseaudio and wpctl for wireplumber.

You’ll need a mechanism to find your triggers (I create a firefox tab with youtube/spotify, I have a music player active) and then you can act on it.

Detecting voice in an audiostream is probably technically possible, but that sounds pretty hard to setup.

QuazarOmega@lemy.lol on 08 Sep 2024 14:13 collapse

So what I’m getting is that I would have to come up with something myself, right? I mean that would be super cool to do, but I don’t have the time to put into that, unfortunately

unlawfulbooger@lemmy.blahaj.zone on 09 Sep 2024 13:10 collapse

Yes, a quick web search later I haven’t found a readymade solution.

Setting the volume for specific outputs is not very hard, so maybe a middleground solution is to have two shortcuts. One for “game mode” and one for “music mode” or whatever.

boredsquirrel@slrpnk.net on 08 Sep 2024 12:30 next collapse

There is a great video on that in German

www.youtube.com/watch?v=I7KzeHtS0Kc

QuazarOmega@lemy.lol on 08 Sep 2024 14:02 collapse

55 minutes? Uhm, could you tell me the relevant section of the video, please?

boredsquirrel@slrpnk.net on 08 Sep 2024 17:27 collapse

No not really

QuazarOmega@lemy.lol on 08 Sep 2024 20:13 next collapse

Why so irritable? I’m just asking, I don’t even know German, I thought since you knew the video already, you could point me in the right direction, rather than me having to sift through it all while also passing it through a translator to hopefully (because I don’t know how well youtube’s auto-translate feature works) find the information I’m looking for in the whole presentation

boredsquirrel@slrpnk.net on 09 Sep 2024 11:40 next collapse

So you dont know german, this changes some things.

The person explains

  • Alsa
  • pulseaudio
  • jack
  • pipewire
  • audio hardware
  • jack plugins
  • common types of audio modulation (compression, limiting, amplifying, equalizing,…)
  • how pipewire combines all of those
boredsquirrel@slrpnk.net on 09 Sep 2024 11:42 collapse

The app is called “carla” and is a plugin host for jack plugins that works with Pipewire

tetris11@lemmy.ml on 09 Sep 2024 11:05 collapse

this is high level trolling, kudos sir

boredsquirrel@slrpnk.net on 09 Sep 2024 11:39 collapse

Hahaha wasnt meant like that

2xsaiko@discuss.tchncs.de on 08 Sep 2024 13:15 next collapse

I’m fairly sure you can do this with Wireplumber hooks. …pages.freedesktop.org/…/events_and_hooks.html

QuazarOmega@lemy.lol on 08 Sep 2024 14:07 collapse

This is the architecture though, I’m asking about an application that can interact with it

[deleted] on 08 Sep 2024 13:33 next collapse

.

[deleted] on 08 Sep 2024 14:08 next collapse

.

QuazarOmega@lemy.lol on 08 Sep 2024 14:18 collapse

On a quick skim I don’t see a way on it to set volume profiles, let alone program behavior based on certain events, is there some menu I might have missed?

gigachad@sh.itjust.works on 09 Sep 2024 07:32 next collapse

If you find a way to do this, it would be cool if you can share it!

QuazarOmega@lemy.lol on 09 Sep 2024 07:58 collapse

Will do, hopefully there is one

tanka@lemmy.ml on 09 Sep 2024 09:49 next collapse

I found this software a couple of days ago. Not sure if it will really help with your first problem 😆 because I’m still figuring it out myself. But looks promising. github.com/wwmm/easyeffects

tetris11@lemmy.ml on 09 Sep 2024 11:10 collapse

Pulseaudio should have hooks

# cat /etc/pulse/default.pa
load-module module-switch-on-connect
load-module module-exec
load-module module-exec arguments="path/to/your/script.sh %s"    

(where %s resolves on trigger to the name of the sink added)

Your script.sh should then match the first argument to the name of the sink you want to control, and then run

# path/to/your/script.sh
if [ "$1" = "THESINKIWANT" ]; then
  pactl set-sink-volume $1 40%
fi