Search code examples
audioportabilityfile-format

Is WAV format the equivalent to BMP in terms of portability?


There are a lot of different file formats to store sound, some compressed, some compatible with specific platforms, etc... The same thing applies to image file format. Now I know that the BMP (bitmap) file format basically stores a 2D array of pixels which is the image basically, without compression or extra features, and as a result is supported by almost any operation system. Is the WAV file format the equivalent to that in the audio world? And if not what is?


Solution

  • In most cases they are pretty similar in concept. Wave format has a standardized header that describes the format of the data, followed by the audio data. One of the fields of the header indicates the audio format. A typical wave file will have an audio format of PCM (1) which means the data is unencoded PCM audio samples. All other values of the audio format indicate that there is some type of compression. Compressed wave files are not very common though but any program that expects to read a wave file needs to at least detect the wave format and error out if it doesn't support a supplied format.

    The page WAVE PCM sound file format gives a pretty decent overview of the format for PCM.

    I think it is fair to say, at this point, that most audio apps across various operating systems are going to understand wave files. Also, the format is so simple that you don't necessarily need a library to read or write the format in your own program.