aboutsummaryrefslogtreecommitdiff
path: root/src/wavhead.h
blob: 1016daf1464b66b43a00333abdd2bf03d6e9b178 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
	wavhead.h: wav file header, to be included twice for integer and float wavs

	copyright ?-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
	see COPYING and AUTHORS files in distribution or http://mpg123.org
	initially written by Samuel Audet
*/

struct
{
	byte riffheader[4];
	byte WAVElen[4]; /* should this include riffheader or not? */
	struct
	{
		byte WAVEID[4];
		byte fmtheader[4];
		byte fmtlen[4];
		struct
		{
			byte FormatTag[2];
			byte Channels[2];
			byte SamplesPerSec[4];
			byte AvgBytesPerSec[4];
			byte BlockAlign[2];
			byte BitsPerSample[2]; /* format specific for PCM */
			#ifdef FLOATOUT
			byte cbSize[2];
			#endif
		} fmt;
		#ifdef FLOATOUT
		byte factheader[4];
		byte factlen[4];
		struct
		{
			byte samplelen[4];
		} fact;
		#endif
		struct
		{
			byte dataheader[4];
			byte datalen[4];
			/* from here you insert your PCM data */
		} data;
	} WAVE;
} RIFF_NAME = 
{
	{ 'R','I','F','F' } ,
	{ sizeof(RIFF_NAME.WAVE),0,0,0 } , 
	{
		{ 'W','A','V','E' },
		{ 'f','m','t',' ' },
		{ sizeof(RIFF_NAME.WAVE.fmt),0,0,0 } ,
		{
			{WAVE_FORMAT,0} , {0,0},{0,0,0,0},{0,0,0,0},{0,0},{0,0}
			#ifdef FLOATOUT
			,{0,0}
			#endif
		} ,
		#ifdef FLOATOUT
		{ 'f','a','c','t' },
		{ sizeof(RIFF_NAME.WAVE.fact),0,0,0 },
		{
			{0,0,0,0} /* to be filled later, like datalen and wavelen */
		},
		#endif
		{ { 'd','a','t','a' }  , {0,0,0,0} }
	}
};