.alac
Example
<audio controls>
<source src="song-alac.m4a" type="audio/mp4">
</audio><audio controls>
<source src="song-aac.m4a" type="audio/mp4; codecs=mp4a.40.2">
<source src="song.mp3" type="audio/mpeg">
</audio>ALAC suits archives; web playback uses AAC, with a codecs value that lets the browser check support first.
Common mistakes
- Expecting an
.m4afile to be lossy, while it can hold lossless ALAC as well as AAC. - Streaming ALAC on a web page, where most browsers outside Apple platforms may not play it.
Interview questions
ALAC vs FLAC: which should I use?
Both are lossless with similar sizes. Use ALAC for Apple devices and apps, and FLAC for wide support elsewhere.
What file extension does ALAC use?
ALAC is usually stored in an MP4 container with the .m4a extension, the same extension used for AAC audio.
Is ALAC free to use?
Yes. Apple released ALAC as open source, so anyone can encode and decode it.