Audacity is a free sound engine and recorder that can record from a number of sources, including the "wave out mix", which is simply the sound coming out of your speakers. You can use Audacity to record the audio as you play it, trim the ends, and encode to .wav, .mp3 (requires the lame mp3 encoder .dll file), or .ogg.
http://audacity.sourceforge.net/