00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#if defined (AUDIO_H)
00018
00019
#else
00020
00021 #define AUDIO_H
00022
00023 #define CHANNELS_MONO 1 // mono
00024 #define CHANNELS_STEREO 2 // stereo
00025 #define SAMPLE_SIZE_8_BITS 8 // 8 bits per sample
00026 #define SAMPLE_SIZE_16_BITS 16 // 16 bits per sample
00027 #define SAMPLING_RATE_8KHz 8000 // 8KHz sampling rate, in Hz
00028 #define SAMPLING_RATE_44KHz 44100 // 44KHz sampling rate, in Hz
00029 #define SAMPLING_RATE_48KHz 48000 // 48KHz sampling rate, in Hz
00030 #define SAMPLING_RATE_96KHz 96000 // 96KHz sampling rate, in Hz
00031
00032 #define SAMPLING_RATE SAMPLING_RATE_48KHz
00033 #define STEP (SAMPLING_RATE / SAMPLING_RATE_8KHz)
00034 #define LENGTH (64 * STEP)
00035
00036
00037
00039
int OpenAudioDevice(
const char *audioDevice);
00040
00042
00045
int SetAudioDevice(
int samplingRate,
int sampleSize);
00046
00048
00049
int CloseAudioDevice();
00050
00052
00054
int ReadFromAudioDevice(
unsigned char *);
00055
00057
00060
int PlayBuffer(
unsigned char *,
long);
00061
00063
00065
int SetMicLevel(
int);
00066
00068
00069
char *
Audio_GetLastError();
00070
00071
#endif