From: hackbard Date: Sat, 15 May 2004 13:08:21 +0000 (+0000) Subject: checkin of incomplete audio.* -> "ice cream & notebook in the garden ..." ;) X-Git-Url: https://www.hackdaworld.org/gitweb/?a=commitdiff_plain;h=525f7820da4d77f38cd90287fe0982c617d7d754;hp=44d1396bcdd42a518855981fc8aa0b0fbc665231;p=my-code%2Fivac.git checkin of incomplete audio.* -> "ice cream & notebook in the garden ..." ;) --- diff --git a/src/audio.c b/src/audio.c new file mode 100644 index 0000000..8698ee9 --- /dev/null +++ b/src/audio.c @@ -0,0 +1,17 @@ +/* audio.c -- audio management stuff + * + * author: hackbard@hackdaworld.dyndns.org + * + */ + +#include "audio.h" + +int audio_init(t_audio *audio) { + + puts("[audio] initializing audio ..."); + + if((audio->fd=open(audio->device,O_RDONLY))==-1) { + perror("[audio] open call"); + return A_ERROR; + } + diff --git a/src/audio.h b/src/audio.h new file mode 100644 index 0000000..b0c01db --- /dev/null +++ b/src/audio.h @@ -0,0 +1,20 @@ +/* audio.h -- audio headers */ + +#ifndef AUDIO_H +#define AUDIO_H + +/* includes */ +#include + +/* defines */ +#define MAX_CHAR_DEVICE 32 +#define SOUND_DEVICE "/dev/dsp" + +/* audio specific variables */ +typedef struct s_audio { + int fd; + char device[MAX_CHAR_DEVICE]; + int cap; +} t_audio; + +#endif