libdragon
Loading...
Searching...
No Matches
src
audio
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
#define WAV64_FORMAT_VADPCM 1
8
10
typedef
struct
__attribute__((packed)) {
11
char
id
[4];
12
int8_t
version
;
13
int8_t
format
;
14
int8_t
channels
;
15
int8_t
nbits
;
16
int32_t
freq
;
17
int32_t
len
;
18
int32_t
loop_len
;
19
int32_t
start_offset
;
20
}
wav64_header_t
;
21
22
_Static_assert
(
sizeof
(
wav64_header_t
) == 24,
"invalid wav64_header size"
);
23
25
typedef
struct
__attribute__((aligned(8))) {
26
int16_t v[8];
27
}
wav64_vadpcm_vector_t
;
28
30
typedef
struct
__attribute__((packed, aligned(8))) {
31
int8_t
npredictors
;
32
int8_t
order
;
33
int16_t
padding
;
34
uint32_t
current_rom_addr
;
35
wav64_vadpcm_vector_t
loop_state[2];
36
wav64_vadpcm_vector_t
state[2];
37
wav64_vadpcm_vector_t
codebook[];
38
}
wav64_header_vadpcm_t
;
39
40
typedef
struct
samplebuffer_s
samplebuffer_t
;
41
47
void
raw_waveform_read
(
samplebuffer_t
*sbuf,
int
base_rom_addr,
int
wpos,
int
wlen,
int
bps);
48
49
#endif
samplebuffer_t
Definition
samplebuffer.h:82
wav64_header_t
Header of a WAV64 file.
Definition
wav64internal.h:10
wav64_header_t::channels
int8_t channels
Number of interleaved channels.
Definition
wav64internal.h:14
wav64_header_t::version
int8_t version
Version of the file (WAV64_FILE_VERSION)
Definition
wav64internal.h:12
wav64_header_t::format
int8_t format
Format of the file (WAV64_FORMAT_RAW)
Definition
wav64internal.h:13
wav64_header_t::nbits
int8_t nbits
Width of sample in bits (8 or 16)
Definition
wav64internal.h:15
wav64_header_t::freq
int32_t freq
Default playback frequency.
Definition
wav64internal.h:16
wav64_header_t::start_offset
int32_t start_offset
Offset of the first sample in the file.
Definition
wav64internal.h:19
wav64_header_t::len
int32_t len
Length of the file (in samples)
Definition
wav64internal.h:17
wav64_header_t::loop_len
int32_t loop_len
Length of the loop since file end (or 0 if no loop)
Definition
wav64internal.h:18
wav64_header_vadpcm_t
Extended header for a WAV64 file with VADPCM compression.
Definition
wav64internal.h:30
wav64_header_vadpcm_t::current_rom_addr
uint32_t current_rom_addr
Current address in ROM.
Definition
wav64internal.h:34
wav64_header_vadpcm_t::npredictors
int8_t npredictors
Number of predictors.
Definition
wav64internal.h:31
wav64_header_vadpcm_t::order
int8_t order
Order of the predictors.
Definition
wav64internal.h:32
wav64_header_vadpcm_t::padding
int16_t padding
Padding
Definition
wav64internal.h:33
wav64_vadpcm_vector_t
A vector of audio samples.
Definition
wav64internal.h:25
raw_waveform_read
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:150
Generated on Fri Dec 13 2024 14:13:12 for libdragon by
1.9.8