Skip to content
saturalabs

What Is an Audio Codec? Formats, Playback and Conversion

Understand audio codecs, how they differ from file containers, and what to check when audio will not play or needs converting.

In this guide
The short version

An audio codec encodes and decodes sound. The file extension may identify a container rather than the codec inside it, so check both when troubleshooting playback or choosing a conversion.

An audio codec is a method for encoding sound into a digital representation and decoding it for playback. A player needs a decoder that understands the audio encoding, and it also needs to read the way the audio is packaged. MP3, AAC and FLAC are examples of audio codecs; they make different tradeoffs between size, fidelity and compatibility.

When someone says a file has an unsupported codec, the filename alone may not explain the problem. Start by identifying the container and audio encoding separately, then check what the destination player or editor accepts. MDN's audio codec guide describes common codec and container combinations.

Choosing a file for recording, editing or sharing? Compare common audio file formats and their practical tradeoffs.

Audio codec vs. container: what is the difference?

A codec describes how sound is encoded and decoded. A container organizes media data, and can also hold information such as metadata or multiple tracks. An extension often points to the container, but does not establish the encoding inside it. For example:

FilePossible audio insideWhat to check
M4AAAC or Apple Lossless (ALAC), among other possibilities.Whether the destination accepts both the MPEG-4 packaging and the actual audio codec.
WebMOften Opus or Vorbis audio; it may also contain video.Whether the destination can read WebM and decode its audio track.
WAVOften uncompressed PCM, but WAV can also contain other encodings.The stored format as well as sample rate, bit depth and channels if required.

See MDN's container guide for more examples. Not every extension is a general-purpose container: an MP3 file is commonly an MP3 audio stream, possibly with metadata. Renaming an M4A file to MP3 does not change its encoding or reliably change its packaging.

Common audio encodings and when to use them

EncodingTypePractical use
MP3LossyA widely supported listening or sharing copy, at the cost of discarded audio information.
AACLossyCommon in MPEG-4 audio and video; support depends on the player, profile and packaging.
Opus and VorbisLossyUsed in web and other media workflows; check both container and decoder support.
FLAC and ALACLosslessCompress audio without discarding decoded sample data, useful when the destination supports them.
Linear PCMUncompressed representationOften stored in WAV for editing or delivery; files can be larger than compressed copies.

Lossy encoding discards some information, while lossless encoding can reproduce the encoded sample data. Neither label proves the source was pristine: a lossless file made from an MP3 still carries the MP3's earlier losses. Read lossy vs. lossless audio and what PCM audio means for the details.

How to fix an unsupported audio codec

  1. Check the source. Confirm the download or transfer finished. Open the file's media information in a compatible player or editor and note its container, audio codec, sample rate and channel count. If the file will not open anywhere, ask the sender for those details and another copy.
  2. Check the destination. Look for its accepted containers and audio codecs, including any profile, sample-rate or channel limits. A device may recognize a container but not the audio inside it.
  3. Try a compatible player or request a new export. If possible, ask for an export from the original project in a format the destination accepts. Keep your source file.
  4. Convert only if needed. Make a separate copy in a supported format, then play the beginning and end and check duration and channels in the destination. A failed or damaged source may not be repairable by conversion.

For a supported WAV, the WAV file inspector can show stored format fields locally. It supports integer PCM and floating-point RIFF/WAVE variants; it is not an MP3 or FLAC inspector and does not repair damaged audio.

Does changing a codec reduce quality?

It can. Converting from one lossy codec to another requires decoding and another lossy encode, which can introduce additional artifacts. Converting a lossy source to PCM WAV or lossless FLAC cannot restore information already discarded. Resampling or changing bit depth can also alter the samples. For a new delivery copy, use the highest-quality suitable source you have and retain it for future exports.

Sometimes a compatible audio stream can be placed into a different compatible container without re-encoding; this is called remuxing. It avoids another audio encode, but it cannot make an unsupported audio codec playable. If the audio itself needs editing, changing codec or changing sample rate, a new encode or processing step may be needed.

For a short compatible M4A, M4A to MP3 can prepare an MP3 or PCM WAV copy in your browser. The file must be at most five minutes and 50 MiB, decode in your browser and contain mono or stereo audio; the output must also fit within 50 MiB. MP3 is a new lossy encode. Review the M4A guide before choosing a format.

Common questions

Is an audio codec the same as bitrate?

No. The codec is the encoding method; bitrate describes data used per unit of time. Bitrate helps estimate size, but it cannot guarantee quality or be compared in isolation across codecs. See audio bitrate explained.

Which audio codec has the best quality?

There is no single best choice for every workflow. For an editable or archival copy, a supported lossless encoding or PCM can preserve the available samples. For distribution, choose a compatible format and evaluate the resulting file by listening.

Can I fix a codec problem by changing the file extension?

No. Renaming does not convert the audio. Identify the actual encoding and use a compatible player, a suitable remux, or a converter as the situation requires.

From the Saturalabs journal

Practical notes on sound isolation, music, and clearer dialogue. About our guides ↗

Your next step

Inspect a WAV file

Check the stored format, sample rate and channels of a supported WAV file.

Open the tool