Waveform Audio Format – .wav Files

This post shall deal with the basics of Audio File storage. We have covered most of the image formats, and I’ll try to put up something on Scalable Vector Graphics (seem interesting :)) after learning it. Anyways, so this wave format is a standard put in by Microsoft and IBM and is derived from the RIFF (Resource Interchange File Format). The difference from the tagged chunks IFF format is the usage of the little-endian for multi-byte reading. The IFF was introduced to exchange data between various companies (Apple, Microsoft and IBM) effectively in the early days. The well known AVI (audio-visual interleaved data) too is a part of this RIFF standard.

This format is extremely simple (like the BMP case in images). I would say there is no encoding on the data which is represented by PCM (Pulse Coded Modulation). This uncompressed case was good in the early days where the Internet transfer of files wasn’t so regular. With the coming and popularisation of the Internet it was felt to reduce these wave file sizes and thus came the now famous MP3.

A crude measurement of the file size can be done in this way:
Time of audio file (in seconds) x No. of Channels x Samples per second (Sampling Rate) x Bits per sample.

Generally used values for each are 2 channel, 44.1kHz (CD Quality), 48kHz (DVD Quality), 8kHz (decent for only speech) and 8-bit (on the lower side), 16-bit (good), 32-bit (overkill!) per sample PCM code.

Now coming to the part of the bit-stream, this is done by making chunks as mentioned earlier. There is a header which gives all the required details of the file, and is followed by the data chunks. Important in the header are the no. of channels, audio format, the sample rate, and bits per sample.

Its interesting to note that 8-bit samples are stored as unsigned integers (0 to 255) while 16-bit samples are stored as 2’s complement integers from -32768 to 32767. For more information on the byte-structure and bit-stream I would suggest to have a look at this to allow me from copying the same redundant information. 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s