Audio Codecs Explained
An audio codec defines how sound is encoded and reconstructed for storage or delivery.
A player opens a movie, displays the picture, and cannot reproduce its soundtrack. The file reader has located the audio track, but the audio still needs a decoder that understands its coded representation.
An audio codec defines that representation and its reconstruction. The same word also commonly names an encoder or decoder implementation.
How compressed packets become audio samples
For compressed audio, a stream consists of coded information rather than a literal number for every sample. Depending on the codec, it can describe frequency components, predictions, remaining errors, or other signal parameters.
The decoder first needs configuration: which coding tools are used, the sample-rate arrangement, channel structure, and other format-specific details. It then interprets successive coded units and produces audio on a sample timeline.
| Information or component | Job |
|---|---|
| Container reader | Locates track data and timing |
| Codec configuration | Describes how the coded audio should be interpreted |
| Decoder | Reconstructs the audio presentation |
| Output processing | Maps it to the listening system |
A container can provide configuration outside the individual audio packets. That is why copying one packet from a file does not necessarily make a complete independently playable recording.
The encoder has decisions the decoder does not repeat
A standard fixes what valid coded information means. Encoders can nevertheless differ in how they choose that information. They may spend more computation searching for a better prediction or allocate bits differently to minimize audible error.
Two encoders can therefore produce different bitstreams from the same recording while one conforming decoder can reconstruct both. Improving an encoder does not necessarily require a new decoder if the encoded format remains within the same supported tools and constraints.
With lossless compression, the choices affect storage efficiency and processing while preserving the represented source samples. With lossy compression, they also affect the approximation the decoder reconstructs.
Identify the supported presentation precisely
Codec families can contain variants requiring different tools. A basic AAC-LC decoder and an xHE-AAC decoder do different reconstruction jobs. Channel count, sample rate, and a supported profile can impose further implementation requirements.
The surrounding package is another independent boundary. An M4A file can carry AAC or ALAC. Changing its extension does not change the coded audio, while changing the wrapper can sometimes solve an input-reader problem without making a new audio encoding.
Repackaging, transcoding, or channel conversion?
For an Emby session:
- If the audio codec is compatible but the wrapper is unsuitable, repackaging can preserve the coded sound.
- If the required reconstruction tools are unsupported, a decoder elsewhere in the path can reconstruct and re-encode a compatible presentation.
- If decoding succeeds but the listening system has fewer channels, layout conversion addresses the output arrangement.
These solve different failures. A playback-path trace identifies which boundary changed, and whether the receiver gets coded audio for its own decoder or already reconstructed PCM.