libmsx
C library for MSX
|
The API of the libmsx audio replayer. More...
Functions | |
void | audio_init (void) |
MSX Initialize the libmsx audio replayer. | |
void | audio_start (void) |
MSX Start / Resume music. | |
void | audio_pause (void) |
MSX Pause music. | |
bool | audio_is_paused (void) |
MSX Return whether paused or not. | |
void | audio_stop (void) |
MSX Stop music. | |
void | audio_play (void) |
MSX Main routine of the libmsx audio replayer. | |
uint8_t | audio_get_bgm_frequency (void) |
MSX Return replayer frequency of the background music. | |
void | audio_set_bgm_frequency (uint8_t freq) |
MSX Force replayer frequency of the background music. | |
bool | audio_is_playing (void) |
MSX Return whether BGM and/or SFX is playing or not. | |
bool | audio_is_playing_bgm (void) |
MSX Return whether BGM is playing or not. | |
bool | audio_is_playing_sfx (void) |
MSX Return whether SFX is playing or not. | |
void | audio_set_repeat (bool repeat) |
MSX Turn on/off the auto-repeat of the BGM. | |
The API of the libmsx audio replayer.
Features of The libmsx audio replayer :
void audio_init | ( | void | ) |
MSX
Initialize the libmsx audio replayer.
This function must be called at least once. In particular, it must be called before the first call to audio_play().
void audio_start | ( | void | ) |
MSX
Start / Resume music.
void audio_pause | ( | void | ) |
MSX
Pause music.
bool audio_is_paused | ( | void | ) |
MSX
Return whether paused or not.
true
if paused. void audio_stop | ( | void | ) |
MSX
Stop music.
void audio_play | ( | void | ) |
MSX
Main routine of the libmsx audio replayer.
To play back background music and sound effects, this function must be called at each VSYNC timing.
The easiest way is to set this function as the VSYNC interrupt handler by calling set_vsync_handler().
uint8_t audio_get_bgm_frequency | ( | void | ) |
MSX
Return replayer frequency of the background music.
void audio_set_bgm_frequency | ( | uint8_t | freq | ) |
MSX
Force replayer frequency of the background music.
freq | frequency in Hz. |
bool audio_is_playing | ( | void | ) |
MSX
Return whether BGM and/or SFX is playing or not.
true
if BGM and/or SFX is playing. bool audio_is_playing_bgm | ( | void | ) |
MSX
Return whether BGM is playing or not.
true
if BGM is playing. bool audio_is_playing_sfx | ( | void | ) |
MSX
Return whether SFX is playing or not.
true
if SFX is playing. void audio_set_repeat | ( | bool | repeat | ) |
MSX
Turn on/off the auto-repeat of the BGM.
repeat | true : turn on, false : turn off |