Definition of wave PCM sound file format

Source: Internet
Author: User
Document directory
  • Notes:
  • General discussion of riff files:
  • References:

The wave file format is a subset of Microsoft's Riff specification for the storage of multimedia files. A riff file starts out with a file header followed by a sequence of data chunks. A wave file is often just a riff file with a single "wave" chunk which consists of two sub-Chunks -- a "FMT" chunk specifying the data format and a "data" chunk ining the actual sample data. call this form the "canonical form ". who knows how it really all works.

I use the standard wave format as created by the Sox program:

 

Offset size Name Description
2ExtraparamsizeIf PCM, then doesn' t exist
XExtraparamsSpace for extra parameters

The "data" subchunk contains the size of the data and the actual sound:

36 4Subchunk2idContains the letters "data"
(0x64617461 big-Endian form ).
40 4Subchunk2size= Numsamples * numchannels * bitspersample/8
This is the number of bytes in the data.
You can also think of this as the size
Of the read of the subchunk following this
Number.
44 *DataThe actual sound data.

As an example, here are the opening 72 bytes of A wave file with Bytes shown as hexadecimal numbers:

52 49 46 46 24 08 00 00 57 41 56 45 66 6D 74 20 10 00 00 00 01 00 02 00
22 56 00 00 88 58 01 00 04 00 10 00 64 61 74 61 00 08 00 00 00 00 00
24 17 1E F3 3C 13 3C 14 16 F9 18 F9 34 E7 23 A6 3C F2 24 F2 11 ce 1A 0d

Here is the interpretation of these bytes as a wave soundfile:

 

Notes:
  • The default byte ordering assumed for wave data files is little-Endian. Files written using the big-Endian byte ordering scheme have the identifier rifx instead of riff.
  • The sample data must end on an even byte boundary. Whatever that means.
  • 8-bit samples are stored as unsigned bytes, ranging from 0 to 255. 16-bit samples are stored as 2's-complement signed integers, ranging from-32768 to 32767.
  • There may be additional subchunks in a wave data stream. If so, each will have a char [4] subchunkid, and unsigned long subchunksize, and subchunksize amount of data.
  • Riff standsResource Interchange File Format.
General discussion of riff files:

Multimedia applications require the storage and management of a wide variety of data, including bitmaps, audio data, video data, and peripheral device control information. riff provides a way to store all these varied types of data. the type of data a riff file contains is indicated by the file extension. examples of data that may be stored in riff files are:

  • Audio/visual interleaved data (. AVI)
  • Waveform data (. wav)
  • Bitmapped data (. RDI)
  • MIDI information (. Rmi)
  • Color palette (. Pal)
  • Multimedia movie (. rmn)
  • Animated Cursor (. Ani)
  • A bundle of other riff files (. BND)

Note: At this point, AVI files are the only type of riff files that have been fully implemented using the current riff specification. although wav files have been implemented, these files are very simple, and their developers typically use an older specification in constructing them.

For more info see http://www.ora.com/centers/gff/formats/micriff/index.htm

 
References:
  1. Riff format reference (good) http://netghost.narod.ru/gff/graphics/summary/micriff.htm ).
  2. Http://www.lightlink.com/tjweber/StripWav/WAVE.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.