Console utilities for reading wave format (.wav) header and data written in C++, C++/Qt, Java.
- WavReader.cpp - written in C++
- WavReaderQt.cpp - written in QT
- MetaReader.java - written in Java
![here] (/wav-sound-format.gif "WAV header")
-
The "RIFF" chunk descriptor:
1-4
"RIFF"Marks the file as a riff file. Characters are each 1 byte long5-8
File size (integer)Size of the overall file - 8 bytes, in bytes (32-bit integer).9-12
"WAVE"File Type Header. For our purposes, it always equals "WAVE". -
The "fmt" sub-chunk:
13-16
"fmt "Format chunk marker. Includes trailing null17-20
16Length of format data as listed above23-24
2Number of Channels - 2 byte integer25-28
44100Sample Rate - 32 byte integer. CSample Rate = Number of Samples per second, or Hertz.29-32
176400(Sample Rate * BitsPerSample * Channels) / 8. Byte rate33-34
4(BitsPerSample * Channels) / 8.1 - 8 bit mono2 - 8 bit stereo/16 bit mono4 - 16 bit stereo35-36
16Bits per sample -
The "data" sub-chunk:
37-40
"data"Marks the beginning of the data section.41-44
File size (data)Size of the data section.44-..
Data samples
The file could have another sub-chunks.