I changed the script a bit, this way, you don't have to define output path in case you need to quickly record something. It will simply write the date and time of the recording in the filename and write it to the home directory.
Code:
#!/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 -t raw -r 44100 -sLb 16 -c 2 - ~/Taped_Recording_$TIME.wav
I also add an entry to my .bashrc to make aliases for quick recording.
Code:
alias tape ="~/bin/soundrip.sh"
Can anyone take this and make it a gnome panel applet for quick graphical recording. I think the functionality is already done (take a look at gtk-recordmydesktop code).