Last active
December 7, 2022 18:38
-
-
Save UnJavaScripter/a9a1536ed0757b99f72ceda644298fe7 to your computer and use it in GitHub Desktop.
A method to combine an input device and a virtual device's signals into a single virtual input device using pipewire & pactl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on the response from user Pujianto over https://superuser.com/questions/1675877/how-to-create-a-new-pipewire-virtual-device-that-to-combines-an-real-input-and-o | |
# Create combined sink | |
pactl load-module module-null-sink media.class=Audio/Sink sink_name=my-combined-sink channel_map=stereo | |
# Link audio source (mic) to combined sink | |
## Get the mic device name with: `pw-link -o` | |
pw-link $NAME_OF_THE_INPUT_DEVICE my-combined-sink:playback_FL | |
pw-link $NAME_OF_THE_INPUT_DEVICE my-combined-sink:playback_FR | |
# Create sound-box virtual device | |
pactl load-module module-null-sink media.class=Audio/Sink sink_name=sound-box-sink channel_map=stereo | |
# Link audio sound-box virtual device to combined sink | |
pw-link $ID_OF_THE_SOUND_BOX_VIRTUAL_DEVICE my-combined-sink:playback_FR | |
# Create Virtual mic (The communication applications will use this one) | |
pactl load-module module-null-sink media.class=Audio/Source/Virtual sink_name=my-virtualmic channel_map=front-left,front-right | |
# Link sink and virtual mic | |
pw-link my-combined-sink:monitor_FL my-virtualmic:input_FL | |
pw-link my-combined-sink:monitor_FR my-virtualmic:input_FR | |
# Send sound to sound-box device | |
pw-play $PATH_TO_SOUND_FILE --volume 0.5 --target sound-box-sink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment