2
#define _FMTHEADERS_H 1
6
/* Definitions for .VOC files */
8
#define MAGIC_STRING "Creative Voice File\x1A"
9
#define ACTUAL_VERSION 0x010A
10
#define VOC_SAMPLESIZE 8
15
#define DATALEN(bp) ((u_long)(bp->datalen) | \
16
((u_long)(bp->datalen_m) << 8) | \
17
((u_long)(bp->datalen_h) << 16) )
19
typedef struct _vocheader
21
u_char magic[20]; /* must be MAGIC_STRING */
22
u_short headerlen; /* Headerlength, should be 0x1A */
23
u_short version; /* VOC-file version */
24
u_short coded_ver; /* 0x1233-version */
28
typedef struct _blocktype
31
u_char datalen; /* low-byte */
32
u_char datalen_m; /* medium-byte */
33
u_char datalen_h; /* high-byte */
37
typedef struct _voice_data
44
typedef struct _ext_block
53
/* Definitions for Microsoft WAVE format */
55
#define RIFF 0x46464952
56
#define WAVE 0x45564157
57
#define FMT 0x20746D66
58
#define DATA 0x61746164
63
/* it's in chunks like .voc and AMIGA iff, but my source say there
64
are in only in this combination, so I combined them in one header;
65
it works on all WAVE-file I have
67
typedef struct _waveheader
69
u_long main_chunk; /* 'RIFF' */
70
u_long length; /* filelen */
71
u_long chunk_type; /* 'WAVE' */
73
u_long sub_chunk; /* 'fmt ' */
74
u_long sc_len; /* length of sub_chunk, =16 */
75
u_short format; /* should be 1 for PCM-code */
76
u_short modus; /* 1 Mono, 2 Stereo */
77
u_long sample_fq; /* frequence of sample */
79
u_short byte_p_spl; /* samplesize; 1 or 2 bytes */
80
u_short bit_p_spl; /* 8, 12 or 16 bit */
82
u_long data_chunk; /* 'data' */
83
u_long data_length; /* samplecount */
89
long magic; /* must be equal to SND_MAGIC */
90
long dataLocation; /* Offset or pointer to the raw data */
91
long dataSize; /* Number of bytes of data in the raw data */
92
long dataFormat; /* The data format code */
93
long samplingRate; /* The sampling rate */
94
long channelCount; /* The number of channels */
98
#define SND_MAGIC ((long int)0x2e736e64)
100
#define SND_FORMAT_UNSPECIFIED (0)
101
#define SND_FORMAT_MULAW_8 (1)
102
#define SND_FORMAT_LINEAR_8 (2)
103
#define SND_FORMAT_LINEAR_16 (3)
104
#define SND_FORMAT_LINEAR_24 (4)
105
#define SND_FORMAT_LINEAR_32 (5)
106
#define SND_FORMAT_FLOAT (6)