Switching between multiple sound configurations - how?

If i wanted to have a command line alias/icon on my desktop that allowed a quick way to switch between audio inputs/outputs where would be the a good first place to look?

Sort of 'click icon#1' and now audio is configured for USB headset, click icon#2 and now configured for analogue out only through external speakers, click icon#3 and now set to normal analogue headset... (for click icon, you could also read "run aliased command line with these switches)

Can i run a command to 'dump' the current setup to a file as a starting point (running ubunbu mate Eoan)

1 Like

Hi,
To do that, you can use the pactl command to figure out more about your audio. Use man pactl and pactl help in a terminal to learn how to use the command.
Basically with pactl list sinks and pactl list, you can figure out the device name you want to use and the input/outputs (called profiles).
Then you can create a bash script and click it or assign it a keyboard shortcut and voilà.

Here I want to grab the HDMI 6 output of my video card (starts from 0), make it the active sound device and set its volume to 100%.

#!/bin/bash
#sets the right output
pactl set-card-profile 0 output:hdmi-stereo-extra5
# sets the chosen device as the active device
pactl set-default-sink alsa_output.pci-0000_01_00.1.hdmi-stereo-extra5
# Sets its volume too 100%
pactl set-sink-volume 0 100%

Hope this helps

I think the following tool is what your search:

2 Likes

Thanks for the info. I'm giving this a try - looks mostly what I want to do.