libdragon
wav64internal.h
1#ifndef __LIBDRAGON_WAV64_INTERNAL_H
2#define __LIBDRAGON_WAV64_INTERNAL_H
3
4#define WAV64_ID "WV64"
5#define WAV64_FILE_VERSION 2
6#define WAV64_FORMAT_RAW 0
7
9typedef struct __attribute__((packed)) {
10 char id[4];
11 int8_t version;
12 int8_t format;
13 int8_t channels;
14 int8_t nbits;
15 int32_t freq;
16 int32_t len;
17 int32_t loop_len;
18 int32_t start_offset;
20
21_Static_assert(sizeof(wav64_header_t) == 24, "invalid wav64_header size");
22
23typedef struct samplebuffer_s samplebuffer_t;
24
30void raw_waveform_read(samplebuffer_t *sbuf, int base_rom_addr, int wpos, int wlen, int bps);
31
32#endif
Definition: samplebuffer.h:82
Header of a WAV64 file.
Definition: wav64internal.h:9
int8_t channels
Number of interleaved channels.
Definition: wav64internal.h:13
int8_t version
Version of the file (WAV64_FILE_VERSION)
Definition: wav64internal.h:11
int8_t format
Format of the file (WAV64_FORMAT_RAW)
Definition: wav64internal.h:12
int8_t nbits
Width of sample in bits (8 or 16)
Definition: wav64internal.h:14
int32_t freq
Default playback frequency.
Definition: wav64internal.h:15
int32_t start_offset
Offset of the first sample in the file.
Definition: wav64internal.h:18
int32_t len
Length of the file (in samples)
Definition: wav64internal.h:16
int32_t loop_len
Length of the loop since file end (or 0 if no loop)
Definition: wav64internal.h:17
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.
Definition: wav64.c:27