libmsx
C library for MSX
Loading...
Searching...
No Matches
The audio decoder interface for the libmsx audio replayer.

#include <audio_dec.h> More...

+ Collaboration diagram for The audio decoder interface for the libmsx audio replayer.:

Data Structures

struct  AudioDecoder
 The audio decoder interface. More...
 

Typedefs

typedef struct AudioDecoder AudioDecoder
 The audio decoder interface.
 

Detailed Description

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

And it can also proivide some APIs such as:

See also
Callback functions of the libmsx audio replayer.
Unified sound-chip buffer of the libmsx audio replayer.

Typedef Documentation

◆ AudioDecoder

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:

  • one is a background music decoder,
  • and the other is a sound effect decoder.

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.

See also
Unified sound-chip buffer of the libmsx audio replayer.
Callback functions of the libmsx audio replayer.