Skip to content

Instantly share code, notes, and snippets.

@iamc
Created May 18, 2017 08:46
Show Gist options
  • Save iamc/22ec9d65d020c7e09e8abf2d9e210de1 to your computer and use it in GitHub Desktop.
Save iamc/22ec9d65d020c7e09e8abf2d9e210de1 to your computer and use it in GitHub Desktop.
script to enable/disable pulseaudio loopback module in order to get eg. mic feedback
#!/bin/bash
#
# Loads / unloads pulseaudio loopback module in order to eg. be redirect
# mic input to headphones.
#
# Usage: mic-loopback [on|off]
#
if [ $# -ne 1 ]; then
echo "Usage: $0 [on|off]"
exit 1
fi
if [[ $1 == "on" ]]; then
pactl load-module module-loopback latency_msec=1
echo "pulseaudio loopback module loaded"
elif [[ $1 == "off" ]]; then
pactl unload-module module-loopback
echo "pulseaudio loopback module unloaded"
else
echo "Usage: $0 [on|off]"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment