M4A

Audio Codecs

A file extension commonly used for MPEG-4 files containing only audio; it can encapsulate codecs such as AAC and ALAC. It describes the file's purpose and container conventions, rather than being a standalone audio codec.

Explanation

M4A is a common file extension for MPEG-4 audio files, typically written as `.m4a`. These files are based on the ISO Basic Media File Format and the MPEG-4 file structure, and organize their content using tracks, media data, timetables, and metadata boxes. M4A is not a standalone audio compression algorithm defined by the ISO standard, but rather a naming convention used by software and distribution systems to distinguish MPEG-4 files that are primarily audio-based.

M4A is not a codec format.

The audio in these files is most commonly encoded using AAC or Apple Lossless Audio Codec (ALAC), though other codecs supported by the container may also be present. AAC is a lossy codec, while ALAC is a lossless codec; the fact that both file types use the `.m4a` extension does not imply that they share the same compression characteristics. Correct identification requires reading the codec identifier in the sample description while also checking the object type, sample rate, bit depth, and number of channels.

Structures such as `moov` within the container store tracks and sample tables, while `mdat` stores media data; tags, cover art, chapters, and seamless playback information can be carried by corresponding metadata boxes. The location of the `moov` structure affects whether progressive web downloads can begin parsing before the file is fully downloaded, but it does not alter the audio codec. Files may also contain multiple audio tracks or other auxiliary data, although common M4A files typically have only one main audio track.

`.m4a`, `.mp4`, and `.m4b` may use the same base container. `.mp4` is commonly used for audio and video programs, while `.m4b` is often used for audiobooks with chapters or bookmarks; the difference in file extensions primarily helps applications choose the appropriate processing method. Simply changing the file extension will not convert the encoding, nor will it fix incompatible internal tracks.

Repackaging an AAC M4A file into another container will not alter the audio stream; converting it to ALAC M4A, however, requires decoding the audio first and then losslessly saving the decoded samples; information lost during the original lossy compression cannot be recovered. Media databases should treat M4A as a container or file type, distinct from actual codecs such as AAC and ALAC.