]> Shamusworld >> Repos - thunder/blob - doc/wav.txt
Added save states; updated application icon.
[thunder] / doc / wav.txt
1
2           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
3           ³ The Microsoft Multimedia WAV Sound File Format ³
4           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
5
6                  Written for the PC-GPE by Mark Feldman
7             e-mail address : u914097@student.canberra.edu.au
8                              myndale@cairo.anu.edu.au
9
10              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
11              ³      THIS FILE MAY NOT BE DISTRIBUTED     ³
12              ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³
13              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
14
15
16 ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
17 ³ Disclaimer ³
18 ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
19
20 I assume no responsibility whatsoever for any effect that this file, the
21 information contained therein or the use thereof has on you, your sanity,
22 computer, spouse, children, pets or anything else related to you or your
23 existance. No warranty is provided nor implied with this information.
24
25 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
26 ³ The RIFF File Format ³
27 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
28
29 WAV files use the RIFF file structure. The RIFF format was designed
30 for multi-media purposes. A RIFF files consists of a number of "chunks":
31
32   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
33   ³ Byte              Length                                               ³
34   ³ Offset   Name   (in bytes)    Description                              ³
35   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
36   ³ 00h      rID        4h        Contains the characters "RIFF"           ³
37   ³ 04h      rLen       4h        The length of the data in the next chunk ³
38   ³ 08h      rData     rLen       The data chunk                           ³
39   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
40
41
42 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
43 ³ The WAVE Form Definition ³
44 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
45
46 The rData chunk in a WAV file is split up into several further chunks:
47
48  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
49  ³ rData                                                                   ³
50  ³ Byte              Length                                                ³
51  ³ Offset   Name   (in bytes)    Description                               ³
52  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
53  ³ 00h      wID        4h        Contains the characters "WAVE"            ³
54  ³ 04h      Format    14h        Contains data which specifies the format  ³
55  ³          Chunk                  of the Data in the Data Chunk           ³
56  ³ 18h      WAVE Data  ?         Contains the WAV audio data               ³
57  ³          Chunk                                                          ³
58  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
59
60
61
62 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
63 ³ The Format Chunk ³
64 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
65
66 The Format Chunk is split up into these fields:
67
68 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
69 ³ Format                                                                  ³
70 ³ Chunk                  Length                                           ³
71 ³ Offset  Name         (in bytes)   Description                           ³
72 ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
73 ³ 00h     fId               4       Contains the characters "fmt"         ³
74 ³ 04h     fLen              4       Length of data in the format chunk    ³
75 ³ 08h     wFormatTag        2       *                                     ³
76 ³ 0Ah     nChannels         2       Number of channels, 1=mono, 2=stereo  ³
77 ³ 0Ch     nSamplesPerSec    2       Playback frequency                    ³
78 ³ 0Eh     nAvgBytesPerSec   2       **                                    ³
79 ³ 10h     nBlockAlign       2       ***                                   ³
80 ³ 12h     FormatSpecific    2       Format specific data area             ³
81 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
82
83 * The wFormatTag specifies the wave format, eg 1 = Pulse Code Modulation
84   (or in plain english, regular 8 bit sampled uncompressed sound)
85
86 ** Indicates the average number of bytes a second the data should be
87    transferred at = nChannels * nSamplesPerSec * (nBitsPerSample / 8)
88
89 *** Indicates the block alignment of the data in the data chunk. Software
90     needs to process a multiplt of nBlockAlign at a time.
91     nBlockAlign = nChannels * (nBitsPerSample / 8)
92
93
94 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
95 ³ The Data Chunk ³
96 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
97
98 The Data Chunk is split up into these fields:
99
100 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
101 ³  Data                                                                   ³
102 ³ Chunk                  Length                                           ³
103 ³ Offset  Name         (in bytes)   Description                           ³
104 ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
105 ³ 00h     dId              4        Contains the characters "data"        ³
106 ³ 02h     dLen             4        Length of data in the dData field     ³
107 ³ 00h     dData            dLen     The actual waveform data              ³
108 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
109
110 In mono 8-bit files each byte represents one sample. In stereo 8-bit files
111 two bytes are stored for each sample, the first byte is the left channel
112 value, the next is the right channel value.