User:MaxLT16384/sandbox/Assignment 6

An audio codec is a codec (a device or computer program capable of encoding or decoding a digital data stream) that encodes or decodes audio.

In software, an audio codec is a computer program implementing an algorithm that compresses and decompresses digital audio data according to a given audio file or streaming media audio coding format. The objective of the algorithm is to represent the high-fidelity audio signal with minimum number of bits while retaining quality. This can effectively reduce the storage space and the bandwidth required for transmission of the stored audio file. Most software codecs are implemented as libraries which interface to one or more multimedia players.

In hardware, audio codec refers to a single device that encodes analog audio as digital signals and decodes digital back into analog. In other words, it contains both an analog-to-digital converter (ADC) and digital-to-analog converter (DAC) running off the same clock signal. This is used in sound cards that support both audio in and out, for instance. Hardware audio codecs send and receive digital data using buses such as AC-Link, I²S, SPI, I²C, etc. Most commonly the digital data is linear PCM, and this is the only format that most codecs support, but some legacy codecs support other formats such as G.711 for telephony.

Audio codecs can be lossless, lossy, or uncompressed. FLAC and ALAC are examples of lossless codecs, MP3 and Ogg Vorbis are examples of lossy codecs, and PCM is an uncompressed audio format.

Psychoacoustics
To minimize the amount of data required to reconstruct an audio signal, the properties of human hearing can be used to remove parts of the signal that do not affect perception. Lossy audio coding schemes remove perceptual irrelevancies to reduce the size of an audio signal while avoiding audible artifacts.

The standard human hearing range is between 20 and 20,000 Hz, so frequencies outside of that range can be safely discarded without affecting perception of the audio signal. Sounds can also be masked, a phenomenon where the louder of two sounds with similar frequencies will drown out the quieter, rendering it inaudible. Sounds can also be masked when immediately before or after a louder sound, an effect known as temporal masking. Sounds that are masked can be removed by an audio codec, as they are inaudible to human listeners.

Uncompressed

 * Pulse Code Modulation

Lossless compression

 * Free Lossless Audio Codec (FLAC)
 * Apple Lossless Audio Codec (ALAC)
 * Windows Media Audio Lossless (WMAL)

Lossy compression

 * Advanced Audio Coding (AAC)
 * MP3
 * Vorbis
 * Windows Media Audio (WMA)