|
SDLGameEngine
|
Sound and music. More...
Data Structures | |
| struct | SGESOUND |
Functions | |
| void | sgeSetDefaultSampleRate (int rate) |
| set the sample rate of the audio device | |
| int | sgeGetDefaultSampleRate (void) |
| get the sample rate of the audio device | |
| void | sgeSetVolume (int volume) |
| set the global playing volume | |
| int | sgeGetVolume (void) |
| SGESOUND * | sgeSoundNew (SGEFILE *f, const char *name) |
| create a sound from a sge data archive | |
| void | sgeSoundDestroy (SGESOUND *m) |
| destroy a sound struct and free memory | |
| void | sgeSoundPlay (SGESOUND *m, int loop, int fadeinms) |
| play a sound | |
| void | sgeSoundStop (SGESOUND *m, int fadeoutms) |
| stop a sound | |
| int | sgeSoundIsPlaying (SGESOUND *m) |
| check if a sound is playing | |
Variables | |
| int | SGESOUND::channel |
| channel the sound is playing | |
Sound and music.
Functions to play sound effects and music.
| int sgeGetDefaultSampleRate | ( | void | ) |
get the sample rate of the audio device
Definition at line 17 of file sgesound.c.
| int sgeGetVolume | ( | void | ) |
brief get the current global volume return the current volume
Definition at line 28 of file sgesound.c.
| void sgeSetDefaultSampleRate | ( | int | rate | ) |
set the sample rate of the audio device
| rate | the rate in kHz |
Use before sgeInit
Definition at line 13 of file sgesound.c.
| void sgeSetVolume | ( | int | volume | ) |
set the global playing volume
| volume | the new volume |
The maximum volume is MIX_MAX_VOLUME
Definition at line 23 of file sgesound.c.
| void sgeSoundDestroy | ( | SGESOUND * | m | ) |
destroy a sound struct and free memory
| m | pointer to SGESOUND |
Definition at line 41 of file sgesound.c.
| int sgeSoundIsPlaying | ( | SGESOUND * | m | ) |
check if a sound is playing
| m | pointer to SGESOUND |
Definition at line 72 of file sgesound.c.
create a sound from a sge data archive
| f | a pointer to a opened SGEFILE |
| name | the file name in the archive |
Definition at line 32 of file sgesound.c.
| void sgeSoundPlay | ( | SGESOUND * | m, |
| int | loop, | ||
| int | fadeinms | ||
| ) |
play a sound
| m | pointer to SGESOUND |
| loop | YES/NO if the sound should be played looping |
| fadeinms | Fade the volume in over n miliseconds |
Definition at line 49 of file sgesound.c.
| void sgeSoundStop | ( | SGESOUND * | m, |
| int | fadeoutms | ||
| ) |
stop a sound
| m | pointer to SGESOUND |
| fadeoutms | Fade the volume out over n miliseconds |
Definition at line 60 of file sgesound.c.