Skip to content

Instantly share code, notes, and snippets.

@jsuereth
Created November 29, 2011 23:46
Show Gist options
  • Save jsuereth/1407202 to your computer and use it in GitHub Desktop.
Save jsuereth/1407202 to your computer and use it in GitHub Desktop.
Testing out pulse audio automated record *everything* script
#!/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