Here is a simple bash script I use to record live audio straight to mp3 on disk. I setup a KDE app-launcher to run the script in a terminal with these options:
--vt_sz 72x10 --noresize --noscrollbar --nomenubar --notabbar -T "dsp capture"
I setup another script/launcher with a "killall sox" command. I put these on the toolbar for quick and dirty line in captures.
#!/bin/bash
# get audio from soundcard and compress it in real-time to mp3
# the 44Khz, 128 bit version
# -----------------------------------------------------------------------------
TD=`date +%F-%H%M%S`
FILE="dspcap_44K128b_$TD.mp3"
echo Capturing /dev/dsp to $FILE
echo
/usr/bin/sox -t ossdsp -w -r 44100 -s -c 2 /dev/dsp -t raw - |/usr/bin/lame -x -m s -s 44.1 -b 128 - $FILE