2 TIME
=$
(date +%Y.
%m.
%d.
%H.
%M.
%S
)
3 OUTPUTFILE
=/tmp
/Recorded_Sound_
$TIME.wav
4 MONITOR
=$
(pactl list |
grep -A2 '^Source #' |
grep 'Name: .*\.monitor$' |
awk '{print $NF}' |
tail -n1)
5 echo "Recording to $OUTPUTFILE, press Ctrl-C or close this window to stop ..."
6 parec
-d "$MONITOR" | sox
-t raw
-r 44100 -sLb 16 -c 2 - $OUTPUTFILE