[linux-audio-dev] Vsound-like tools for ALSA?

Mike Rawes mike_rawes at yahoo.co.uk
Wed Jan 28 09:42:51 UTC 2004


On Tue, 27 Jan 2004 22:57:02 -0600
Tom Felker <tcfelker at mtco.com> wrote:

> Hi,
> 
> Are there tools to copy audio to a file as it goes through ALSA to the
> 
> soundcard?  I'm basically looking for something like VSound, but for 
> everything, not just apps that can be coaxed to use OSS.
> 
> If not, would there be a way to implement such a tool without
> resorting to vsound-style LD_PRELOAD hacks?

(Disclaimer: I've not used this very much at all - I did knock up a
quick test :)

The ALSA file plugin can do this.

Try putting this in ~/.asoundrc:

pcm.fileout {
  type file
  slave.pcm "hw:0,0"
  file alsaout.raw
}

..then aplay -D fileout foo.wav

will create a file called alsaout.raw

Of course, in that case it's easier to just cp foo.wav!

It's likely you'll want to record the output from realplayer or
something. If you have OSS emulation set in ALSA, try adding this to the
same .asoundrc:

pcm.dsp0 {
  type plug
  slave.pcm "fileout"
}

then 
# aoss realplay 

*should* record realplay output to the same fileout.raw

(Note: aoss uses LD_PRELOAD hackery)

Quite how you determine the format of the .raw file is beyond me -
anybody?!

- 
Myk



More information about the Linux-audio-dev mailing list