pro_linux_programming thread: using ioctl to program audio (how do I use a stream?)
Hello Drew,
Take a look at the fileno function. It takes a file pointer (of
type FILE) and returns a file descriptor.
Have Fun!
Bruce...
-----Original Message-----
From: kirkpatricda@n...
[mailto:kirkpatricda@n...]
Sent: Tuesday, January 15, 2002 12:19 PM
To: Pro Linux Programming
Subject: [pro_linux_programming] using ioctl to program audio (how do I
use a stream?)
I've patched together a rudimentary audio system using ioctl calls, and
a
custom stereo encode. Now that I have it playing buffers properly
encoded,
I was hoping to take it to the next level and open a stream to /dev/dsp
and
write into that stream. Unfortunatly, ioctl calls only take file
descriptors of an int type, while the stream functions I've been trying
return file descriptors of the FILE type. I want to keep ioctl so that I
can continue verifying that the device file is indeed a soundcard, but
then
use the stream. I figured at worst I could use the int based file
descriptor to do all the ioctl verification stuff, and setup, then open
a
stream to the same device. I'm afraid to close the file descriptor,
because
I would assume that I would lose my soundcard settings. Does anyone have
any recommendations here?
-Drew
$subst('Email.Unsub').