The data chunk in the Wave file format has the following structure.
|Byte sequence description||Length in bytes||Starts at byte in the chunk||Value|
|chunk ID||4||0x00||The ASCII character string "data"|
|size||4||0x04||The size of the data chunk (number of bytes) less 8 (less the "chunk ID" and the "size"). This size is also the size of the sampled audio data. For example, a one second audio data recorded at 44,100 Hz on 1 channel with 16 bits sampling resolution will have 44100 * 1 * 16 / 8 = 88,200 bytes of data|
|data||various||0x08||The sampled audio data|
If there are more than one channels in the sampled audio data (see Format chunk (of a Wave file)), for example 2 channels, the sampled audio data is stored in the following order.
sample 0 for channel 1
sample 0 for channel 2
sample 1 for channel 1
sample 1 for channel 2
sample 2 for channel 1
sample 2 for channel 2
As with all information in wave files, data is stored little-endian. The number 88,200 = 0x00015888 will be stored as the byte sequence 0x88 0x58 0x01 0x00. Also, all information has to be word aligned (at every two bytes). If the audio data contains an odd number of bytes, it should be padded with a zero byte, although this byte will not be counted in the size variable.
Wave file format
Add new comment