libmsx
C library for MSX
|
#include <audio_dec.h>
More...
Data Structures | |
struct | AudioDecoder |
The audio decoder interface. More... | |
Typedefs | |
typedef struct AudioDecoder | AudioDecoder |
The audio decoder interface. | |
#include <audio_dec.h>
The audio decoder interface for the libmsx audio replayer.
The libmsx audio replayer can handle two dedicated audio decoders:
Each of the above audio decoders must implement the audio decoder interface of type AudioDecoder
.
A music data loader or audio decoder implementation for the libmsx audio replayer must provide either or both of the follwing decoder specific APIs:
audio_cb_bgm_changed()
.audio_cb_sfx_changed()
.And it can also proivide some APIs such as:
struct AudioDecoder |
The audio decoder interface.
This object is used by libmsx audio replayer to decode music data.
The libmsx audio replayer can handle two dedicated audio decoders:
Decode music data then Store in the buffer
The decoder decodes the music data each time it is called and stores it in libmsx audio replayer's internal FIFO buffer by calling audio_buf_put()
.
To do this, each of the above audio decoders must implement the audio decoder interface of type AudioDecoder
.
Attach the decoder to the libmsx audio replayer
The decoder must be attached to the replayer when a music data is changed or set to the decoder by the decoder specific API.
A decoder for background music (BGM) shall be attached to the replayer by audio_cb_bgm_changed()
. So the audio_cb_bgm_changed()
should be called when the BGM is changed or set to the decoder by the decoder specific API.
A decoder for sound effects (SFX) shall be attached to the replayer by audio_cb_sfx_changed()
. So the audio_cb_sfx_changed()
should be called when the SFX is changed or set to the decoder by the decoder specific API.
Definition at line 89 of file audio_dec.h.
Data Fields | ||||
---|---|---|---|---|
bool(*)(void) | decode_update |
Function pointer to the decoder I/F decode_update() . This function is called by This function shall decodes the next sampled value of the music data. Then, by calling the function If a music data has been set to the decoder and it is not reached to the end of music, this shall return If no music data is set to the decoder or the music is already finished, this shall return
| ||
void(*)(void) | decode_final |
Function pointer to the decoder I/F decode_final() . This function is called by If
| ||
void(*)(bool repeat) | set_repeat |
Function pointer to the decoder I/F set_repeat() . Turn on/off the auto-repeat of the music. This function is called by
|
typedef struct AudioDecoder AudioDecoder |
The audio decoder interface.
This object is used by libmsx audio replayer to decode music data.
The libmsx audio replayer can handle two dedicated audio decoders:
Decode music data then Store in the buffer
The decoder decodes the music data each time it is called and stores it in libmsx audio replayer's internal FIFO buffer by calling audio_buf_put()
.
To do this, each of the above audio decoders must implement the audio decoder interface of type AudioDecoder
.
Attach the decoder to the libmsx audio replayer
The decoder must be attached to the replayer when a music data is changed or set to the decoder by the decoder specific API.
A decoder for background music (BGM) shall be attached to the replayer by audio_cb_bgm_changed()
. So the audio_cb_bgm_changed()
should be called when the BGM is changed or set to the decoder by the decoder specific API.
A decoder for sound effects (SFX) shall be attached to the replayer by audio_cb_sfx_changed()
. So the audio_cb_sfx_changed()
should be called when the SFX is changed or set to the decoder by the decoder specific API.