Skip to content

Instantly share code, notes, and snippets.

@jmcarbo
Created July 13, 2016 13:36
Show Gist options
  • Save jmcarbo/057a328565045695b045ba8b430635a9 to your computer and use it in GitHub Desktop.
Save jmcarbo/057a328565045695b045ba8b430635a9 to your computer and use it in GitHub Desktop.
#!/bin/bash
#This script require sox
#sudo apt-get install sox
TIME=$(date +%d-%b-%y_%H%M-%Z)
# Get sink monitor:
MONITOR=$(pactl list | grep -A2 '^Source #' | \
grep 'Name: .*\.monitor$' | awk '{print $NF}' | tail -n1)
# Record it raw, and convert to a wav
echo "Recording. Ctrl-C or close window to stop"
parec -d "$MONITOR" | sox -v 5.0 -t raw -r 44100 -e signed-integer -Lb 16 -c 2 -V3 - Taped_Recording_$TIME.wav silence 1 3.0 0.1% 1 0.3 0.1% : newfile : restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment