Score:0

How do I change the audio output for one specific application?

ph flag

I want to change my audio output for Spotify by NOT changing the default settings to be able to hear music over my sound system and play everything else with my headset.

I already searched in the settings of Spotify as well as in the settings of my system but found noting. My system runs with 20.04.2 LTS and I just switched from Windows on Linux so everything should be up to date.

ChanganAuto avatar
us flag
Unless the specific software has the ability to use a different sound output it can't be done. VLC has such feature, Spotify hasn't.
Nate T avatar
it flag
@ChanganAuto It _can_ be done. You can control the output of any app. You may not be able to switch its source, but you can move the output of the default stream. You can even pipe streams into commands if you know how. Its just data. Pulseaudio even lets you tie your audio output to another remote output over the internet if that is what you need. This isn,t windows. No isn't an answer in our world. Our version of no is "its kinda complicated." XD
Score:0
it flag

Just like anything in Linux, you can do it at different levels. This is just one possibility. However, doing this isn't as simple as just running a command. You need to know what you're doing, so you can undo it if need be. For this reason, my answer will get you most of the way and provide links to get you the rest of the way.

REROUTING

First, you need to set up a stream to that output. To do this, you use pulseaudio. This is the program that supplies the audio stream to the applications. It works in terms of sources(inputs) and sinks (outputs).
streams are what connects them. You can think of it as a patch-cord. That is really all pulseaudio is. If youve ever seen a modular synthesizer, pulseaudio is the software version, except it doesn't change the audio. It just directs it.

You can learn more and get the commands you need here. Its alot, but that is a good thing. Look through the contents at the top and find the sections you need. I suggest you bookmark it. It will pay in diviends, I promise.

AUTOMATING

From there you can edit ~/.bash_aliases so that the command to open that app also switches streams (or moves the current stream). Look at the aliases set in ~/.bashrc lines 78-84 to see what I mean about the alias-to-add-functionality concept. If you don't want to mess with setting up a stream, you can just move the sink-input to a different sink.

NOTE:

Just in case you can't locate ~/.bashrc, it is because it is hidden. You need to run the ls command with an -a option to see files that start with a period.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.