Main Page | Class List | File List | Class Members | File Members

Audio.h File Reference

Go to the source code of this file.

Defines

#define AUDIO_H
#define CHANNELS_MONO   1
#define CHANNELS_STEREO   2
#define SAMPLE_SIZE_8_BITS   8
#define SAMPLE_SIZE_16_BITS   16
#define SAMPLING_RATE_8KHz   8000
#define SAMPLING_RATE_44KHz   44100
#define SAMPLING_RATE_48KHz   48000
#define SAMPLING_RATE_96KHz   96000
#define SAMPLING_RATE   SAMPLING_RATE_48KHz
 Sampling rate used by Wr.

#define STEP   (SAMPLING_RATE / SAMPLING_RATE_8KHz)
 Wr reading increment.

#define LENGTH   (64 * STEP)
 sequence length


Functions

int OpenAudioDevice (const char *audioDevice)
 Just opens /dev/dsp and /dev/mixer.

int SetAudioDevice (int samplingRate, int sampleSize)
 Sets /dev/dsp's parameters and allocates the buffer.

int CloseAudioDevice ()
 Simply closes /dev/dsp and /dev/mixer.

int ReadFromAudioDevice (unsigned char *)
 Reads LENGTH samples and stores them in the buffer - LENGTH is defined in Audio.h.

int PlayBuffer (unsigned char *, long)
 Plays the buffer "buffer" back throug the SoundBlaster.

int SetMicLevel (int)
 Sets the IGAIN level, acting on the mixer.

char * Audio_GetLastError ()
 Returns the last error.


Define Documentation

#define AUDIO_H
 

#define CHANNELS_MONO   1
 

#define CHANNELS_STEREO   2
 

#define LENGTH   (64 * STEP)
 

sequence length

#define SAMPLE_SIZE_16_BITS   16
 

#define SAMPLE_SIZE_8_BITS   8
 

#define SAMPLING_RATE   SAMPLING_RATE_48KHz
 

Sampling rate used by Wr.

#define SAMPLING_RATE_44KHz   44100
 

#define SAMPLING_RATE_48KHz   48000
 

#define SAMPLING_RATE_8KHz   8000
 

#define SAMPLING_RATE_96KHz   96000
 

#define STEP   (SAMPLING_RATE / SAMPLING_RATE_8KHz)
 

Wr reading increment.


Function Documentation

char* Audio_GetLastError  ) 
 

Returns the last error.

Returns:
A string containing the last error

int CloseAudioDevice  ) 
 

Simply closes /dev/dsp and /dev/mixer.

int OpenAudioDevice const char *  audioDevice  ) 
 

Just opens /dev/dsp and /dev/mixer.

Parameters:
audioDevice The device to be opened. Should be "/dev/dsp" or "/dev/audio"
Returns:
+1:success
-1:error - Use Audio_GetLastError() for details

int PlayBuffer unsigned char *  ,
long 
 

Plays the buffer "buffer" back throug the SoundBlaster.

Parameters:
[in] buffer The buffer to be played.
size The size of the buffer, in bytes.
Returns:
+1:success
-1:error - Use Audio_GetLastError() for details

int ReadFromAudioDevice unsigned char *   ) 
 

Reads LENGTH samples and stores them in the buffer - LENGTH is defined in Audio.h.

Parameters:
[out] buffer The buffer which will contain read samples.
Returns:
+1:success
-1:error - Use Audio_GetLastError() for details

int SetAudioDevice int  samplingRate,
int  sampleSize
 

Sets /dev/dsp's parameters and allocates the buffer.

Parameters:
samplingRate The sapling frequency. Wr uses SAMPLING_RATE_48KHz.
samleSize The size of a sample, in bytes. Wr uses SAMPLE_SIZE_8_BITS.
Returns:
+1:success
-1:error - Use Audio_GetLastError() for details

int SetMicLevel int   ) 
 

Sets the IGAIN level, acting on the mixer.

Parameters:
volume The value of the IGAIN level
Returns:
+1:success
-1:error - Use Audio_GetLastError() for details


Generated on Fri Jul 23 11:36:01 2004 for WhistleRecogniser by doxygen 1.3.7