CQEAudioController controls audio output, such as setting volume, outputting tones, playing PCM/WAV files, and synthesizing text to speech.
More...
#include <qeaudio.h>
List of all members.
Public Member Functions |
| SINGLETON (CQEAudioController) |
| This internal macro handles instantiation of this class.
|
void | SetVolume (unsigned char vol) |
| Sets the volume of the audio speaker.
|
int | PlayTone (unsigned short frequency, int duration) |
| Plays a tone for a specified period of time.
|
int | PlayClip (const char clip[], int length) |
| Plays a PCM audio clip in memory.
|
int | PlayClip (const char *filename) |
| Plays a PCM audio file.
|
int | Talk (const char *string) |
| Converts a piece of text to human speech and plays it.
|
Detailed Description
CQEAudioController controls audio output, such as setting volume, outputting tones, playing PCM/WAV files, and synthesizing text to speech.
To instantiate this class:
And when done with this class, call Release(), for each call to GetPtr() or GetRef():
Member Function Documentation
int CQEAudioController::PlayClip |
( |
const char |
clip[], |
|
|
int |
length | |
|
) |
| | |
Plays a PCM audio clip in memory.
- Parameters:
-
| clip | data array that contains PCM audio |
| length | length of data array in bytes |
- Returns:
- result code (0=success, otherwise error)
int CQEAudioController::PlayClip |
( |
const char * |
filename |
) |
|
Plays a PCM audio file.
- Parameters:
-
| filename | name of PCM file to play. Relative filename paths are with respect to the current directory. |
- Returns:
- result code (0=success, otherwise error)
int CQEAudioController::PlayTone |
( |
unsigned short |
frequency, |
|
|
int |
duration | |
|
) |
| | |
Plays a tone for a specified period of time.
- Parameters:
-
| frequency | the frequency of the tone in Hertz. This value should be no less and 50 and no greater than 20000 or either inaudible audio, or an inaccurate frequency will result. |
| duration | the duration that you wish the sound to be played in milliseconds. |
- Returns:
- result code (0=success, otherwise error)
void CQEAudioController::SetVolume |
( |
unsigned char |
vol |
) |
|
Sets the volume of the audio speaker.
- Parameters:
-
| vol | value between 0 and 255 with 0 being silent (off) and 255 being maximum volume. |
This internal macro handles instantiation of this class.
int CQEAudioController::Talk |
( |
const char * |
string |
) |
|
Converts a piece of text to human speech and plays it.
- Parameters:
-
| string | the text to be converted to speech |
- Returns:
- result code (0=success, otherwise error)
The documentation for this class was generated from the following files: