In Linux, there are various ways of recording the soundcard output raw.

Sound daemon

There are many "sound daemons" available for Linux. These are often used to support network audio; You can start application on one machine, and the sound magically travels over the network and can be heard on another. Also, they are used to provide mixing of multiple audio streams on software; a real lifesaver in case the soundcard doesn't support hardware mixing. They also allow "monitoring" of data, which is, of course, what we are about to do here.

EsounD (aka esd and Enlightened Sound Daemon) is one such daemon; it's widely supported in GNOME applications and elsewhere.

After setting the thing up (esd running, and the software reportedly plays sound through it), all you need to do is to try esdmon. Like this:

$ esdmon > recording.raw

Interrupt with Ctrl+C, as usual. You can also pipe that directly to sox to convert to desired format or to process it. Or, take the heavy weaponry and pipe it to ecasound or such...

Reportedly, there's a tool called esddsp that also allows plain ordinary OSS (/dev/dsp) using applications to be routed through esd and further through esdmon to file.

ALSA

ALSA drivers rock, and offer much more flexibility than OSS audio drivers.</plug>

ALSA also has feature that "secure" audio format makers probably hate with passion: the fact that audio can be copied right back from the sound card...

In theory, this thing can be done using ALSA's PCM device "copy"; like this spell put to ~/.asoundrc:

pcm.copy {
  type plug
  slave {
    pcm hw
  }
  route_policy copy
}

And then recording things from the card like this:

$ arecord -t wav -D copy target.wav

...but personally, I haven't got this to work; either my skills are lacking, or maybe this won't work properly with the OSS emulation layer that I keep loaded...