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:
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.