Remove libasound dependency. We're using OSS.
[aftubes.git] / sound-ioctl.c
blobfad10f7f6b6f54d0df98d8e2c228baf06af5aea7
1 /* Easier writing these bits in C rather
2 than defining the ioctls in D */
4 #include "fcntl.h"
5 #include "linux/soundcard.h"
7 int sound_set_format(int fd, int format)
9 int tmp;
10 tmp = format;
11 if (ioctl(fd, SNDCTL_DSP_SETFMT, &tmp) == -1
12 || tmp != format)
14 return -1;
15 } else {
16 return 0;
20 int sound_set_srate(int fd, int srate)
22 int tmp;
23 tmp = srate;
24 if (ioctl(fd, SNDCTL_DSP_SPEED, &tmp) == -1
25 || tmp != srate)
27 return -1;
28 } else {
29 return 0;
33 int sound_set_channels(int fd, int channels)
35 int tmp;
36 tmp = channels;
37 if (ioctl(fd, SNDCTL_DSP_CHANNELS, &tmp) == -1
38 || tmp != channels)
40 return -1;
41 } else {
42 return 0;