There is a neat little ap that is bundled with alsa called arecord. I like to make things simple and it don't get much simpler when it comes to capturing audio on a linux box than arecord.
Our workstations use AudioExcel 6 channel sound cards with a CM8738 chip. The listing below shows how arecord would be used with these cards for a 15 second recording at "CD" wav quality. Note that the -D hw:0,0 is the setting for our soundcards but this will vary depending on the sound card. Of course alsa has to be set up properly.
rick@rick:~$ arecord -d 15 -D hw:0,0 -f cd test01.wav
Recording WAVE 'test01.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Tie that command to an icon or run it in konsole and you'll get a KDE popup window asking you how long you want to record for. Enter the time in minutes, hit OK and let audcap run in the background with or without your speakers on. Click the thumbnail below for a screenshot. You will find the script
here.

################################################################################
# /usr/local/bin/audcap RM20071012
# a simple script for capturing audio straight off the soundcard using kdialog
# and arecord. Figuring out which device you are copying might be a pain but
# after you've sorted that out, this is a handy little script to link to an icon
# on your desktop.
#
# Read the manpage to understand options.
# "-D hw:0,0" option refers to the # PCM device (on my soundcard) used to capture
# the audio. Yours may be different.
#
# "-f cd" indicates a CD stereo quality format
#
# "`date +%g%m%d%H%M`.wav will provide a timestamp name for the wav file
################################################################################