libdragon
|
Support for WAV64 audio files. More...
Macros | |
#define | VADPCM_REFERENCE_DECODER 0 |
Set to 1 to use the reference C decode for VADPCM. | |
#define | WAV_RIFF_ID "RIFF" |
#define | WAV_RIFX_ID "RIFX" |
Functions | |
void | raw_waveform_read (samplebuffer_t *sbuf, int base_rom_addr, int wpos, int wlen, int bps) |
Utility function to help implementing WaveformRead for uncompressed (raw) samples. | |
void | wav64_open (wav64_t *wav, const char *fn) |
Open a WAV64 file for playback. | |
void | wav64_play (wav64_t *wav, int ch) |
Start playing a WAV64 file. | |
void | wav64_set_loop (wav64_t *wav, bool loop) |
Configure a WAV64 file for looping playback. | |
int | wav64_get_bitrate (wav64_t *wav) |
Get the (possibly compressed) bitrate of the WAV64 file. | |
void | wav64_close (wav64_t *wav) |
Close a WAV64 file. | |
Variables | |
int64_t | __wav64_profile_dma = 0 |
Profile of DMA usage by WAV64, used for debugging purposes. | |
Support for WAV64 audio files.
#define WAV_RIFF_ID "RIFF" |
ID of a standard WAV file
#define WAV_RIFX_ID "RIFX" |
ID of a WAVX file (big-endian WAV)
void raw_waveform_read | ( | samplebuffer_t * | sbuf, |
int | base_rom_addr, | ||
int | wpos, | ||
int | wlen, | ||
int | bps | ||
) |
Utility function to help implementing WaveformRead for uncompressed (raw) samples.
This function uses PI DMA to load samples from ROM into the sample buffer.
void wav64_open | ( | wav64_t * | wav, |
const char * | fn | ||
) |
Open a WAV64 file for playback.
This function opens the file, parses the header, and initializes for playing back through the audio mixer.
wav | Pointer to wav64_t structure |
fn | Filename of the wav64 (with filesystem prefix). Currently, only files on DFS ("rom:/") are supported. |
void wav64_play | ( | wav64_t * | wav, |
int | ch | ||
) |
Start playing a WAV64 file.
This is just a simple wrapper that calls mixer_ch_play on the WAV64's waveform (wav64_t::wave). For advanced usages, please call directly the mixer functions.
wav | Pointer to wav64_t structure |
ch | Channel of the mixer to use for playback. |
int wav64_get_bitrate | ( | wav64_t * | wav | ) |
Get the (possibly compressed) bitrate of the WAV64 file.
wav | Pointer to wav64_t structure |