WAVE File Format Specification

 

 

What is WAVE file?

WAVE is a audio file format that is used for storing audio bits in a file. It has evolved from the Microsoft RIFF specification for storing digital audio format. Although WAV can store compressed audio, it is usually known for storing uncompressed Linear PCM encoded audio. This is a standard audio format used on Windows computers. Usually, it uses .wav or .wave as file extension. 

WAVE Specification

WAV Specification
WAV Specification

Details about Field Attribute

The WAVE file format start with RIFF header. Then it consists of two subsequent sections called “fmt ” subchunks and “data” subchunks. The “fmt ” subchunks keeps the information about the audio data format. The “data” subchunks describes the size information and the actual audio data.

 

Attribute File Offset Size Description
Chunk ID 0 4 ASCII text “RIFF” (0x52494646)
Chunk Size 4 4 File size – 8 bytes ( 8 bytes represent Chunk ID and Chunk Size)
Format 8 4 ASCII text “WAVE (0x57415645)
       
Subchunk1 ID 12 4 ASCII text “fmt ” (0x666d7420)
SubChunk1 Size 16 4 Length of the format data
Audio Format 20 2 Type of Format, PCM = 1
Number of Channels 22 2 Number of Channel, 1 = mono, 2 = stereo
Sample Ra 24 4 Sample rate. Number of Sample per second (Hz).
Example. 16000, 32000
Byte Rate 28 4 (Sample Rate * Bits per Sample * Number of Channels) / 8
Block Align 32 2 (Bits per Sample * Number of Channels) / 8
Bits per Sample 34 2 Audio bits per sample
       
SubChunk2 ID 36 4 ASCII text “data”. (0x64617461)
SubChunk2 Size 40 4 Size of the data subchunks
Audio Data 44 Actual audio data

Other Details

In the wave format specification there can be different chunk sections. As mentioned above “data” is one of the chunk in a basic WAV file. But sometime other type of chunk section can appear. For example, in some WAV file a LIST chunk can be present which can provide different information such as author, company, copyright information etc.

 

If you are interested in code, please find a generic WAV file parser information here.

 

Related Posts

2 thoughts on “WAVE File Format Specification

  1. Thanks for the nice article! It was helpful to me for just getting the quick gist of the format.

    I wonder if you mind adding one small thing – code that reads a WAV file should ignore chunk types that it doesn’t know about without failing to parse.

    The reason it matters is that we want WAV readers to successfully handle files that have other chunks besides “fmt” and “data”.

Leave a Reply

Your email address will not be published. Required fields are marked *