libmsx
C library for MSX
|
SNDDRV APIs. More...
Macros | |
#define | SND_SPEED_1X (16) |
The value of the playback speed multiplier for 1.0x speed. | |
Functions | |
uint8_t | snd_get_bgm_frequency (void) |
MSX Returns default frequency of the background music. | |
uint8_t | snd_get_player_frequency (void) |
MSX Returns current player frequency of the background music. | |
void | snd_set_player_frequency (uint8_t freq) |
MSX Force player frequency of the background music. | |
void | snd_set_speed (uint8_t multiplier) |
MSX Sets the playback speed multiplier for background music. | |
void | snd_set_repeat (bool repeat) |
MSX Turn on/off the auto-repeat of the BGM. | |
void | snd_set_bgm (uint8_t index, const snd_SoundAssets *sa) |
MSX Sets the specified music as BGM in the sound driver. | |
void | snd_set_sfx (uint8_t index, const snd_SoundAssets *sa) |
MSX Sets the specified music as SFX (sound effects) in the sound driver. | |
void | snd_set_sfx_with_priority (uint8_t index, const snd_SoundAssets *sa, uint8_t priority) |
MSX Sets the specified music as SFX (sound effects) in the sound driver. | |
bool | snd_is_playing (void) |
MSX Return whether BGM and/or SFX is playing or not. | |
bool | snd_is_playing_bgm (void) |
MSX Return whether BGM is playing or not. | |
bool | snd_is_playing_sfx (void) |
MSX Return whether SFX is playing or not. | |
void | snd_init (void) |
MSX Initialize the PSG and the sound driver. | |
void | snd_start (void) |
MSX Start / Resume music. | |
void | snd_pause (void) |
MSX Pause music. | |
bool | snd_is_paused (void) |
MSX Return whether paused or not. | |
void | snd_stop (void) |
MSX Stop music. | |
void | snd_play (void) |
MSX Main routine of the sound driver. | |
Variables | |
const AudioDecoder | SND_BGM_DECODER |
const AudioDecoder | SND_SFX_DECODER |
SNDDRV APIs.
#define SND_SPEED_1X (16) |
The value of the playback speed multiplier for 1.0x speed.
uint8_t snd_get_bgm_frequency | ( | void | ) |
MSX
Returns default frequency of the background music.
uint8_t snd_get_player_frequency | ( | void | ) |
MSX
Returns current player frequency of the background music.
void snd_set_player_frequency | ( | uint8_t | freq | ) |
MSX
Force player frequency of the background music.
freq | frequency in Hz. |
void snd_set_speed | ( | uint8_t | multiplier | ) |
MSX
Sets the playback speed multiplier for background music.
This function is used to control the playback speed of background music.
The playback speed multiplier is specified by a value of 16 times. For example, a value of 16 means a playback speed of 1.0x, and a value of 24 means 1.5x. (i.e. Speed multiplier values are fixed-point numbers with a 4-bit integer part and a 4-bit decimal part.)
multiplier | the playback speed multiplier |
void snd_set_repeat | ( | bool | repeat | ) |
MSX
Turn on/off the auto-repeat of the BGM.
repeat | true : turn on, false : turn off |
void snd_set_bgm | ( | uint8_t | index, |
const snd_SoundAssets * | sa | ||
) |
MSX
Sets the specified music as BGM in the sound driver.
index | Number of a music to be played as BGM. |
sa | Pointer to the sound assets that contains the music. |
void snd_set_sfx | ( | uint8_t | index, |
const snd_SoundAssets * | sa | ||
) |
MSX
Sets the specified music as SFX (sound effects) in the sound driver.
index | Number of a music to be played as SFX. |
sa | Pointer to the sound assets that contains the music. |
snd_set_sfx_with_priority(index, sa, 0)
. void snd_set_sfx_with_priority | ( | uint8_t | index, |
const snd_SoundAssets * | sa, | ||
uint8_t | priority | ||
) |
MSX
Sets the specified music as SFX (sound effects) in the sound driver.
If a SFX is not being played, or if the given priority is higher than or equal to that of the currently playing SFX, the specified SFX will be played. Otherwise, nothing will be done.
index | Number of a music to be played as SFX. |
sa | Pointer to the sound assets that contains the music. |
priority | Priority of the SFX. |
bool snd_is_playing | ( | void | ) |
MSX
Return whether BGM and/or SFX is playing or not.
true
if BGM and/or SFX is playing.bool snd_is_playing_bgm | ( | void | ) |
MSX
Return whether BGM is playing or not.
true
if BGM is playing.bool snd_is_playing_sfx | ( | void | ) |
MSX
Return whether SFX is playing or not.
true
if SFX is playing.void snd_init | ( | void | ) |
MSX
Initialize the PSG and the sound driver.
void snd_start | ( | void | ) |
void snd_pause | ( | void | ) |
bool snd_is_paused | ( | void | ) |
MSX
Return whether paused or not.
void snd_stop | ( | void | ) |
void snd_play | ( | void | ) |
MSX
Main routine of the sound driver.
|
extern |
|
extern |