Skip to content

Instantly share code, notes, and snippets.

@an0ndev
Created August 22, 2021 22:51
Show Gist options
  • Select an option

  • Save an0ndev/34fd9578a279e2db204d7cc0ac1a2db6 to your computer and use it in GitHub Desktop.

Select an option

Save an0ndev/34fd9578a279e2db204d7cc0ac1a2db6 to your computer and use it in GitHub Desktop.
Selectively redirect application audio to VoIP apps along with default input while they play over default output
# ADD THE FOLLOWING LINES TO THE END OF /etc/pulse/default.pa to make them automatically run when pulse starts up (you will have to run 'pulseaudio -k' to restart pulse)
# to test without making it permanent, run each line from a terminal with "pacmd" in front, eg "pacmd load-module module-null-sink (etc)"
# combined_output: sink to accept audio from desired applications
load-module module-null-sink sink_name=combined_output sink_properties=device.description=combined_output
# send combined_output to real sink (eg speakers, headphones, etc)
load-module module-loopback source=combined_output.monitor sink=@DEFAULT_SINK@ latency_msec=1
# combined_input: sink to accept audio from combined_output and real source (eg mic)
load-module module-null-sink sink_name=combined_input sink_properties=device.description=combined_input
# send combined_output to combined_input
load-module module-loopback source=combined_output.monitor sink=combined_input latency_msec=1
# send real source to combined_input
load-module module-loopback source=@DEFAULT_SOURCE@ sink=combined_input latency_msec=1
# NOW, TO USE, YOU JUST NEED TO (manually, with pavucontrol)
# - Set recording application(s) to use "Monitor of combined_input" as their source
# - Set the application(s) generating the audio you want to forward to use "combined_output" as their sink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment