From 525f7820da4d77f38cd90287fe0982c617d7d754 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sat, 15 May 2004 13:08:21 +0000 Subject: [PATCH] checkin of incomplete audio.* -> "ice cream & notebook in the garden ..." ;) --- src/audio.c | 17 +++++++++++++++++ src/audio.h | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/audio.c create mode 100644 src/audio.h 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 -- 2.39.2