libdragon
|
Support for WAV64 audio files. More...
Macros | |
#define | WAV_RIFF_ID "RIFF" |
#define | WAV_RIFX_ID "RIFX" |
Functions | |
void | raw_waveform_read (samplebuffer_t *sbuf, int current_fd, int wpos, int wlen, int bps) |
Utility function to help implementing WaveformRead for uncompressed (raw) samples. | |
void | raw_waveform_read_address (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 *file_name) |
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. | |
void | __wav64_init_compression_lvl3 (void) |
Initialize wav64 compression level 3. | |
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 | fd, | ||
int | wpos, | ||
int | wlen, | ||
int | bps | ||
) |
Utility function to help implementing WaveformRead for uncompressed (raw) samples.
This function uses a file descriptor to load samples from ROM into the sample buffer.
void raw_waveform_read_address | ( | samplebuffer_t * | sbuf, |
int | 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. Note: Tempory function should be removed when XM64 moves to using FILE*.
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.
It is possible to start the same waveform on multiple independent channels. Playback will automatically stop when the waveform is finished, unless it is looping. To stop playing a wav64 file before it is normally finished, call mixer_ch_stop on the channel used for playback.
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 |