bd4764491e07195b18056f261f09c576f24b7b00
[my-code/ivac.git] / src / audio.c
1 /* audio.c -- audio management stuff
2  *
3  * author: hackbard@hackdaworld.dyndns.org
4  *
5  */
6
7 #include "audio.h"
8
9 int audio_init(t_audio *audio) {
10
11   puts("[audio] initializing audio ...");
12
13   if((audio->fd=open(audio->device,O_RDONLY))==-1) {
14     perror("[audio] open call");
15     return A_ERROR;
16   }
17
18   if(ioctl(audio->fd,SNDCTL_DSP_GETCAPS,&(audio->cap))==-1) {
19     perror("[audio] ioctl call");
20     return A_ERROR;
21   }
22
23