]> hackdaworld.org Git - my-code/ivac.git/commitdiff
checkin of incomplete audio.* -> "ice cream & notebook in the garden ..." ;)
authorhackbard <hackbard>
Sat, 15 May 2004 13:08:21 +0000 (13:08 +0000)
committerhackbard <hackbard>
Sat, 15 May 2004 13:08:21 +0000 (13:08 +0000)
src/audio.c [new file with mode: 0644]
src/audio.h [new file with mode: 0644]

diff --git a/src/audio.c b/src/audio.c
new file mode 100644 (file)
index 0000000..8698ee9
--- /dev/null
@@ -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 (file)
index 0000000..b0c01db
--- /dev/null
@@ -0,0 +1,20 @@
+/* audio.h -- audio headers */
+
+#ifndef AUDIO_H
+#define AUDIO_H
+
+/* includes */
+#include <sys/soundcard.h>
+
+/* 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