Whats the format of a WAV file?
A WAV file is a particular type of RIFF file. The possible formats for RIFF files are quite extensive, but here I will describe a straightforward WAV file, which is a RIFF file containing just one WAV data chunk. Header in C-speak: struct WAV_format { char riff[4]; /* the characters “RIFF” */ unsigned long file_length; /* file length – 8 */ char wave[8]; /* the characters “WAVEfmt ” */ unsigned long offset; /* position of “data”-20 (usually 16) */ unsigned short format; /* 1 = PCM */ unsigned short nchans; /* #channels (eg. 2=stereo) */ unsigned long sampsec; /* #samples/sec (eg. 44100 for CD rate) */ unsigned long bytesec; /* #bytes/sec (see note 1) */ unsigned short bytesamp; /* #bytes/sample (see note 1) */ unsigned short bitsamp; /* #bits/sample (see note 1) */ char otherstuff[N]; /* N = offset-16 (see note 5) */ char dataheader[4]; /* the characters “data” */ unsigned long datalen; /* #bytes of actual data */ }; Immediately following this header are the actual bytes of data, inter