Utilities for using maxmod to play sound effects. More...
Go to the source code of this file.
Macros | |
| #define | MM_MODULE_FULL_VOLUME 1024 |
| The maximum volume for maxmod module volume (main theme) | |
| #define | MM_SFX_FULL_VOLUME 255 |
| The maximum volume for maxmod mm_sound_effect.volume. | |
| #define | MM_PAN_CENTER 128 |
| The center pan of stereo audio for maxmod. | |
| #define | MM_BASE_PITCH_RATE 1024 |
| The default pitch rate for the sound effect played. | |
| #define | SFX_DEFAULT_VOLUME MM_SFX_FULL_VOLUME |
| Default volume for sound effects. | |
| #define | SFX_DEFAULT_PAN MM_PAN_CENTER |
| The default stereo pan, will always be center pan. | |
| #define | GBAL_MM_NUM_CHANNELS 14 |
Functions | |
| void | play_sfx (mm_word id, mm_word rate, mm_byte volume) |
| Play a sound effect, wrapper for mmEffectEx() See https://maxmod.org/ref/functions/mm_sound_effect.html and https://maxmod.org/ref/functions/mmEffectEx.html. | |
| void | play_lose_music (void) |
| Play music at a low pitch and slow tempo (lose screen) | |
| void | play_regular_music (void) |
| Play music at a normal pitch and tempo. | |
| void | set_volume (int volume) |
| int | volume_module_step_to_val (unsigned char step) |
| Get MaxMod module audio value from VOLUME_OPTION value. | |
Utilities for using maxmod to play sound effects.
Definition in file audio_utils.h.
| #define GBAL_MM_NUM_CHANNELS 14 |
The number of audio channels to allocate for maxmod, passed to mmInitDefault()
Definition at line 56 of file audio_utils.h.
| #define MM_BASE_PITCH_RATE 1024 |
The default pitch rate for the sound effect played.
Increasing the rate increases the pitch, while decreasing lowers the pitch.
Definition at line 37 of file audio_utils.h.
| #define MM_MODULE_FULL_VOLUME 1024 |
The maximum volume for maxmod module volume (main theme)
Definition at line 17 of file audio_utils.h.
| #define MM_PAN_CENTER 128 |
The center pan of stereo audio for maxmod.
Definition at line 29 of file audio_utils.h.
| #define MM_SFX_FULL_VOLUME 255 |
The maximum volume for maxmod mm_sound_effect.volume.
Definition at line 23 of file audio_utils.h.
| #define SFX_DEFAULT_PAN MM_PAN_CENTER |
The default stereo pan, will always be center pan.
Definition at line 49 of file audio_utils.h.
| #define SFX_DEFAULT_VOLUME MM_SFX_FULL_VOLUME |
Default volume for sound effects.
Definition at line 43 of file audio_utils.h.
| void play_lose_music | ( | void | ) |
Play music at a low pitch and slow tempo (lose screen)
Definition at line 116 of file audio_utils.c.
| void play_regular_music | ( | void | ) |
Play music at a normal pitch and tempo.
Definition at line 135 of file audio_utils.c.
| void play_sfx | ( | mm_word | id, |
| mm_word | rate, | ||
| mm_byte | volume | ||
| ) |
Play a sound effect, wrapper for mmEffectEx() See https://maxmod.org/ref/functions/mm_sound_effect.html and https://maxmod.org/ref/functions/mmEffectEx.html.
| id | the sound id to play, from maxmod compiled soundbank.h header |
| rate | the pitch rate, the default value is MM_BASE_PTCH_RATE |
| volume | the volume ranging from 0 (silent) to 255 (loudest) |
Definition at line 103 of file audio_utils.c.
| void set_volume | ( | int | volume | ) |
Definition at line 146 of file audio_utils.c.
|
inline |
Get MaxMod module audio value from VOLUME_OPTION value.
| step | VOLUME_OPTION between VOLUME_OPTION_MIN and VOLUME_OPTION_MAX |
Definition at line 85 of file audio_utils.h.