Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Routing audio with virtual audio cables

I'm running a set of programs where I need to chain route the audio.

Program 1 generates audio which needs to be silently routed into program 2, and then program 2 creates a new audio source which needs to be silently routed into program 3. Finally program 3 creates audio which should go to the speakers.

Can anyone help me figure out what the best way to achieve this is? I've managed to route audio silently from program 1 into program 2 using "sudo modprobe snd-aloop", which gives me a loopback device.

But now i'm stuck on how silently route that audio into program 3. Oh and this can't be achieved by pipes.
by

1 Answer

Kajalsi45d
Pulseaudio, or pure ALSA? Pulseaudio is easiest: Create a dummy sink
pacmd load-module module-null-sink sink_name=tmpsink


and let program 1 output to it. Program 2 reads from the tmpsink.monitor source. And so on. All this can be scripted. pacmd help shows more commands that may be useful, e.g. list-sink-inputs, list-source-outputs, or move-sink-input and move-sink-output if you can't specify sources and sinks for the programs on the commandline.

Login / Signup to Answer the Question.