Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats the format of a WAV file?

file format wav
0
10 Posted

Whats the format of a WAV file?

0
10

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123