Many of the file formats were originally designed to work with a specific processor chip. For example, the AIFF format was designed for the Motorola 680x0-based Apple Macintosh, which used big-endian byte order), but later substituted AIFC with the advent of Intel chips, which were little-endian byte order for the encoded audio, but not for the other file information. Microsoft WAV or WAVE format was designed for the Intel 80x86 processors, in which the LSB comes first (big-endian). Most high-resolution file formats are now bi-endian, which is great, because it gets really confusing to keep track of as formats change and evolve and it allows the file formats to be as cross-platform as possible.
Audio files have two main nomenclatures relating to their function. The first is the codec or how the actual audio has been encoded and needs to be decoded. For example, we mentioned linear PCM encoding earlier on in the quantization section. The second designation for a file is its container format, sort of like the wrapper you put your ham sandwich in. Whether it is plastic wrap, or a Ziploc bag, it still contains your ham sandwich. A container, such as WAVE, mp3, or FLAC will not only contain the encoded audio data, but also metadata that specifies everything from the type of audio encoding that follows, to file length, sample or bit rate, endianess, compression scheme and depth, etc.. Some containers only accept certain codecs, such as AIFF, which only accepts only uncompressed linear PCM, while others accept a variety of codecs. For example, AIFF's sister format AIFC accepts both uncompressed linear PCM and compressed audio such as the μ-law encoding we mentioned earlier.
You may encounter a third nomenclature when dealing with web audio and your web browser, which is a media type (formerly MIME type), such as audio/mpeg which lets your browser know how to reproduce the file type and contents, calling on an installed helper app if necessary. If your browser can't play back a particular type of audio file, you may need to add it's MIME type in your browser, or your browser might not support that MIME type at all.
Most of the formats below, originating from the video game company Electronic Arts' EA Interchange File Format 85 concept, are structured in chunks, with each chuck containing a header with information about what follows, such as the chunk ID (ckID), which describes aspects of the data to follow (for example, number of channels, sampling rate, endianess, compression scheme, and so forth), chunk size (ckSize), and finally the chunk data itself, which can be the actual audio samples or other types of data. Some containers combine the ckID and ckSize, or even put the size last (see .caf below). An IFF-style file can contain many chunks. If a chunk isn't needed for a particular use, it can be skipped and ignored. The ID3v2 tag chunk, for example, often found in mp3 files, may list extensive information about the music title, performer, etc. which appears in iTunes or streams across your car stereo, beats per minute, but can also be skipped. An AIFC file contains an entry in the COMM (Comment) chunk that describes whether there is compression or not, and what type of compression it might be.
Finally, file types can be classified as being either lossless uncompressed, lossless compressed, or lossy compressed (synonymous with "lousy compressed" at low bit rates). To stress again, keep your master copies in uncompressed format and then transcode to a lossy format when needed. Try not to transcode from one lossy format to another, which degrades the quality even further, but start again from your uncompressed copy. Below is a chart of the most common of each in current use in 2020, but for further detail, here is an excellent article on various codecs.
Most Common Audio File Types for Electronic Studios | ||
---|---|---|
Lossless Uncompressed | AIFF | WAVE |
Lossless Compressed | FLAC | ALAC |
Lossy Compressed | AAC | MP3 |
Perception-based Audio Compression
Video games and computer graphics programs have long saved computation overhead by not calculating portions of a scene that are out of view off-screen. In an effort to save memory space, or faster file transfers for sharing on the Web, etc., engineers developed similar strategies for removing portions of digital audio information that would not be perceived based on psychoacoustic principles, primarily the masking phenomenon discussed in the Acoustics chapter. The MP3 encoding algorithm that was developed in the late 1980's could offer acceptable audio quality (for those more concerned about space/speed than quality) with a compression savings of approximately 10:1; a 10 Mb uncompressed 44.1 kHz file might be a 1 Mb MP3 file at 128 kbps (kilobits per seconds). In addition, the format allowed for variable bit rates (VBR) in addition to constant bit rates (CBR), so more information could be included where needed, and less when not. AAC is the more recent perceptual encoding format and does a somewhat better job. It is the default for most mobile phones, game consoles, etc. as of this writing. The importance for composers is that compressed formats discard information that can never be retrieved from the compressed files, and therefore (one more time), do not master your music in compressed formats. For an excellent, more detailed description of the encoding process, explore this page.
Some of the common sound file format types are (.xxx indicates common filename extensions used for these formats):
Some legacy or less frequently used formats:
There are many, many more sound formats out there currently in use, many coming into existence and those that have hit the dust bin. A Web search for audio codecs and audio file formats will yield many results.
Most audio programs and DAWs will save existing files in alternate formats, called transcoding, either interleaved or as separate mono files, including Digital Performer, Logic, Adobe Audition and Adobe Media Encoder, etc. Below are some of the many choices Adobe Audition gives for transcoding an audio file with "Save As..."
In addition, utility programs for creating, editing or fixing files headers can be extremely useful. A fantastic and free (thanks Tom) program, SoundHack by Tom Erbe for converting sound file formats and much more can be found here (being updated for Catalina 64-bit now).