Skip to content

Audio codecs overview

current

New to audio coding? Start with the intro. Otherwise, this is the short version of what to pick.

You wantUseNotes
Lossy audio for most things — music, speech, video soundtracksOpusBest quality per bit across the whole range, from low-bitrate speech to near-transparent music. Ogg, WebM, Matroska, MP4.
Lossy audio that has to play on everything, including hardware players, TVs and old phonesAAC in MP4/M4AThe safe choice for MP4 video and streaming.
Lossy audio for really old devicesMP3Needs more bitrate than AAC or Opus for the same quality, but plays on anything.
Lossless archive or lossless deliveryFLACOpen, fast, supported nearly everywhere.
Lossless in an Apple-only libraryALACSame idea as FLAC; Apple’s ecosystem prefers it.
Lossless with a lossy-plus-correction hybrid modeWavPackNiche; the hybrid mode is its selling point.
Surround on Blu-ray, TVs and receiversDolby (AC-3, E-AC-3, TrueHD)Keep the original track when remuxing; re-encoding costs quality.
Object-based or immersive audioSpatial audioAtmos, MPEG-H, IAMF and so on are metadata systems on top of codecs.

Vorbis and Speex are both superseded by Opus. Keep them only for existing files or devices that require them.

CodecTypeTypical channelsContainersEncoders
OpusLossyMono and stereo; multichannel via channel mapping familiesOgg, WebM, Matroska, MP4libopus (opusenc, FFmpeg libopus)
AACLossyUp to 5.1 and 7.1 in common profilesMP4/M4A, MPEG-TS, ADTS, MatroskaApple, Fraunhofer FDK, FFmpeg native
MP3LossyMono and stereo onlyRaw MP3, Matroska, MP4LAME
VorbisLossy1–255Ogg, WebM, Matroskalibvorbis
FLACLossless1–8Native FLAC, Ogg, Matroskaflac, FFmpeg
ALACLossless1–8MP4/M4A, MOVApple, FFmpeg
WavPackLossless or hybridMany (hundreds supported)Native WavPack, Matroskawavpack, FFmpeg
SpeexLossy, speech onlyMono and stereoOggspeexenc

FLAC stores 4–32-bit integer PCM. ALAC stores 16, 20, 24 and 32-bit integer PCM, though FFmpeg’s encoder writes only 16 and 24-bit. WavPack also stores 32-bit float and DSD.

MP3, AAC in MP4 and FLAC play in every current browser. Opus and Vorbis in Ogg or WebM play in Chrome, Edge and Firefox, and Safari 18.4 added Ogg Opus and Vorbis on recent Apple operating systems. ALAC is effectively Safari-only, AC-3 and E-AC-3 play only where the operating system supplies a licensed decoder (Apple platforms, some Windows and TV browsers), and Speex and WavPack need an application-supplied decoder. The image and audio support guide has the detection code.

More channels is not the same as spatial audio. Immersive systems describe objects, scenes and speaker layouts in metadata that a renderer interprets; the actual samples are carried by an ordinary codec. See spatial and immersive audio.