function cleanup() { pactl unload-module module-pipe-source pactl unload-module module-loopback } trap cleanup INT pactl load-module module-pipe-source source_name=virtmic file=/tmp/virtmic format=s16le rate=48000 channels=2 pactl set-default-source virtmic pactl load-module module-loopback CLIP=$(ls $HOME/.config/soundboard | dmenu -l 100) ffmpeg -re -i "$HOME/.config/soundboard/$CLIP" -f s16le -ar 48000 -ac 2 - > /tmp/virtmic cleanup