bx-lib : the Basic X11 Library tuned for C beginners
1.0
|
Data Structures | |
struct | bx_audio |
the type for an audio soundtrack More... |
Typedefs | |
typedef struct bx_audio | bx_audio |
the type for an audio soundtrack |
Functions | |
void | bx_init_audio (void) |
bx_audio | bx_load_audio (char const filename[]) |
bx_audio | bx_load_audio_f (char const format[],...) |
void | bx_play_audio (bx_audio audio, double volume, unsigned long millisec, int ad_infinitum) |
void bx_init_audio | ( | void | ) |
Initializes the audio library. The function is available if the library was compiledwith audio support. No other audio function should be called before this one.
bx_audio bx_load_audio | ( | char const | filename[] | ) |
Loads an audio soundtrack in WAV format from a filename.
filename | the path to the filename of the WAV file to be loaded |
bx_audio bx_load_audio_f | ( | char const | format[], |
... | |||
) |
Loads an audio soundtrack in WAV format from a printf()-like format yielding the filename of the sound file.
format | the printf()-like format ... the arguments of the format yielding the filename |
void bx_play_audio | ( | bx_audio | audio, |
double | volume, | ||
unsigned long | millisec, | ||
int | ad_infinitum | ||
) |
Plays an audio soundtrack. The track is played in background mixed with other tracks still played, and the function returns immediately. You can specify the volume, a delay before the sound is played (that is, it will be played in the future) and whether it will be played only once or repeeatedly ad infinitum.
audio | the soundtrack to play |
volume | a volume rate between 0.0 (mute) and 1.0 (max volume) |
millisec | the delay in millesconds before the track starts |
ad_infinitum | boolean stating whether the sound repeats over and over |