Created
November 29, 2011 23:46
-
-
Save jsuereth/1407202 to your computer and use it in GitHub Desktop.
Testing out pulse audio automated record *everything* script
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
#!/bin/bash | |
MONITORS=$(pactl list | egrep -A2 '^(\*\*\* )?Source #' | grep 'Name: .*$' | awk '{print $NF}') | |
if [[ "$1" == "" ]]; then | |
echo "Must specify a recording directory!" | |
echo "" | |
echo "Usage: ./record-all.sh <directory>" | |
exit 1 | |
fi | |
dir="$1" | |
if test ! -d $dir; then | |
mkdir -p $dir | |
fi | |
PROCESSES="" | |
for MONITOR in $MONITORS; do | |
WAV="${dir}/${MONITOR}.wav" | |
echo "Recording $WAV..." | |
echo "set-source-mute ${MONITOR} false" | pacmd >/dev/null | |
pacat -r -d $MONITOR --file-format=wav "$WAV" & | |
PROCESSES="${PROCESSES} $1" | |
done | |
echo "Recording.... Press Ctl-C to cancel..." | |
sleep 1d | |
kill -9 $PROCESSES |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment