James wrote:
> how can i capture the data that my soundcard produces when it makes sounds?
> e.g i run an mpeg decoder, whilst it's playing i have some other program
> (that i'm trying to write) that captures this data (what device, etc?) and
> writes it to a file (actually it'll send it out a serial port, but that's
> later on).
>
> i have an idea that i need to read some device file, but which one?
> i think if i read /dev/dsp whilst the sound is being played it will contain
> what the soundcard is currently playing (i tried it by :
> cat some_wav > /dev/dsp > temp.wav,
> bwavplay temp.wav
>
> and it sounded the same)
> is that right?
No. `cat some_wav > /dev/dsp > temp.wav' does exactly the same thing
as `cat some_wav > temp.wav', i.e. it copies the file.
Reading from /dev/dsp won't help either, as that will record from the
card's audio-in.
In general, you can't read the data which is written to a character
device, pipe, socket, etc except by being at the other end of it. In
the case of a character device, this means being in the kernel.
I recall reading about a device driver which would let you read what
was sent to the soundcard, but I don't remember where.
--
Glynn Clements <[EMAIL PROTECTED]>