Anaudio codec is a device or computer program capable of encoding or decoding a digital data stream (acodec) that encodes or decodesaudio.[1][2][3][4] In software, an audio codec is a computer program implementing an algorithm thatcompresses and decompresses digital audio data according to a given audio file or streaming mediaaudio coding format. The objective of the algorithm is to represent the high-fidelity audio signal with a minimum number of bits while retaining quality. This can effectively reduce the storage space and thebandwidth required for transmission of the stored audio file. Most software codecs are implemented aslibraries which interface to one or moremultimedia players. Most modern audio compression algorithms are based onmodified discrete cosine transform (MDCT) coding andlinear predictive coding (LPC).
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 ananalog-to-digital converter (ADC) anddigital-to-analog converter (DAC) running off the sameclock signal. This is used insound cards that support both audio in and out, for instance. Hardware audio codecs send and receive digital data usingbuses such asAC'97,SoundWire,[5]I²S,SPI,I²C, etc. Most commonly the digital data islinear PCM, and this is the only format that most codecs support, but some legacy codecs support other formats such asG.711 for telephony.