dotfiles/.local/bin/soundboard

16 lines
446 B
Text
Raw Normal View History

2023-12-20 22:52:16 -05:00
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