libdragon
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
wav64_internal.h File Reference

Go to the source code of this file.

Data Structures

struct  wav64_header_t
 Header of a WAV64 file. More...
 
struct  wav64_vadpcm_vector_t
 A vector of audio samples. More...
 
struct  wav64_header_vadpcm_t
 Extended header for a WAV64 file with VADPCM compression. More...
 
struct  wav64_compression_t
 WAV64 pluggable compression algorithm. More...
 

Macros

#define WAV64_ID   "WV64"
 WAV64 file identifier.
 
#define WAV64_FILE_VERSION   2
 WAV64 file version.
 
#define WAV64_FORMAT_RAW   0
 Raw audio format.
 
#define WAV64_FORMAT_VADPCM   1
 VADPCM compressed format.
 
#define WAV64_FORMAT_OPUS   3
 Opus compressed format.
 
#define WAV64_NUM_FORMATS   4
 Number of supported formats.
 

Functions

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

Detailed Description

Author
Giovanni Bajo giova.nosp@m.nnib.nosp@m.ajo@g.nosp@m.mail.nosp@m..com

Data Structure Documentation

◆ wav64_header_t

struct wav64_header_t

Header of a WAV64 file.

Data Fields
char id[4] ID of the file (WAV64_ID)
int8_t version Version of the file (WAV64_FILE_VERSION)
int8_t format Format of the file (WAV64_FORMAT_RAW)
int8_t channels Number of interleaved channels.
int8_t nbits Width of sample in bits (8 or 16)
int32_t freq Default playback frequency.
int32_t len Length of the file (in samples)
int32_t loop_len Length of the loop since file end (or 0 if no loop)
int32_t start_offset Offset of the first sample in the file.

◆ wav64_vadpcm_vector_t

struct wav64_vadpcm_vector_t

A vector of audio samples.

Data Fields
int16_t v[8] Samples.

◆ wav64_header_vadpcm_t

struct wav64_header_vadpcm_t

Extended header for a WAV64 file with VADPCM compression.

Data Fields
int8_t npredictors Number of predictors.
int8_t order Order of the predictors.
uint16_t padding padding
uint32_t padding1 padding1
wav64_vadpcm_vector_t loop_state[2] State at the loop point.
wav64_vadpcm_vector_t state[2] Current decompression state.
wav64_vadpcm_vector_t codebook[] Codebook of the predictors.

Function Documentation

◆ raw_waveform_read()

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.

◆ raw_waveform_read_address()

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