Last active
September 18, 2023 19:19
-
-
Save KmolYuan/f113809cc0341f3526df589cdb226841 to your computer and use it in GitHub Desktop.
Microphone feedback on Linux.
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
#!/usr/bin/env bash | |
# Directs audio input (e.g. mic) to audio output (e.g. speakers), | |
# then sleeps forever. Stops audio redirection when it is killed. | |
# So, for example, plug your phone into the PC's mic, run 'listen', | |
# and listen to phone audio through your computer's speakers. | |
set -e | |
module=$(pactl load-module module-loopback latency_msec=50) | |
function cleanup { | |
pactl unload-module $module | |
} | |
trap cleanup EXIT | |
sleep infinity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment