projects
/
my-code
/
ivac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
display api improvements - to be continued
[my-code/ivac.git]
/
src
/
audio.h
diff --git
a/src/audio.h
b/src/audio.h
index
b0c01db
..
33e90cb
100644
(file)
--- a/
src/audio.h
+++ b/
src/audio.h
@@
-4,17
+4,50
@@
#define AUDIO_H
/* includes */
#define AUDIO_H
/* includes */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
#include <sys/soundcard.h>
/* defines */
#define MAX_CHAR_DEVICE 32
#define SOUND_DEVICE "/dev/dsp"
#include <sys/soundcard.h>
/* defines */
#define MAX_CHAR_DEVICE 32
#define SOUND_DEVICE "/dev/dsp"
+#define A_SUCCESS 1
+#define A_ERROR -1
+
+#define BIT_8 AFMT_U8
+#define BIT_16 AFMT_S16_LE
+#define MONO 1
+#define STEREO 2
+
/* audio specific variables */
typedef struct s_audio {
/* audio specific variables */
typedef struct s_audio {
- int fd;
- char device[MAX_CHAR_DEVICE];
- int cap;
+ int dsp_fd;
+ int mixer_fd;
+ char dsp_dev[MAX_CHAR_DEVICE];
+ char mixer_dev[MAX_CHAR_DEVICE];
+ int dsp_cap;
+ int fmt;
+ int channels;
+ int speed;
+ int blksize;
+ int mixer_cap;
+ unsigned char volume;
+ unsigned char *play_data;
+ unsigned char *rec_data;
} t_audio;
} t_audio;
+/* function prototypes */
+int audio_init(t_audio *audio);
+int audio_setup(t_audio *audio);
+int audio_shutdown(t_audio *audio);
+int audio_play(t_audio *audio,int len);
+int audio_record(t_audio *audio,int len);
+
#endif
#endif