On 2001-07-07 18:53 -0400, Greg Berchin wrote:

> I notice that you simply "open" /dev/dsp as write-only. 
> Farther down I see that you used "ioctl" -- I've never seen that function
> before.  What does it do?

ioctl() is a multi-purpose system call that acts on a file
descriptor. It's used to perform operations that don't fit in
the open-read-write-lseek-close Unix model.

The first argument is a file descriptor, the second argument is
an operation. After the second argument, there are sometimes
more arguments, depending on the operation.

Most operations are specific to a particular type of device. For
a file descriptor pointing to an OSS /dev/dsp device, you could
use the following operations :

  SNDCTL_DSP_SETFMT
  SNDCTL_DSP_STEREO
  SNDCTL_DSP_SPEED
  SNDCTL_DSP_SETFRAGMENT
  SNDCTL_DSP_GETBLKSIZE
  SNDCTL_DSP_GETOSPACE

and more. They're explained in detail in the doc at

  http://www.opensound.com/pguide/

If you want a paper book, you might want to take a look at
"Linux multimedia guide" by Jeff Tranter at O'Reilly. Perhaps
it talks about those ioctl()s.

-- 
Andr� Majorel <[EMAIL PROTECTED]>
http://www.teaser.fr/~amajorel/

Reply via email to