Apple open sourced their lossless audio codec last week. Pretty awesome! I have a theory that, given enough time, absolutely every codec will be open source in one way or another.
I know I shouldn’t bother reading internet conversation around any news related to multimedia technology. And if I do read it, I shouldn’t waste any effort getting annoyed about them. But here are some general corrections:
- ALAC is not in the same league as — nor is it a suitable replacement for — MP3/AAC/Vorbis or any other commonly used perceptual audio codec. It’s not a matter of better or worse; they’re just different families of codecs designed for different purposes.
- Apple open sourced ALAC, not AAC– easy mistake, though there’s nothing to ‘open source’ about AAC (though people can, and will, argue about its absolute ‘open-ness’).
- There’s not much technical room to argue between ALAC and FLAC, the leading open source lossless audio compressor. Both perform similarly in terms of codec speeds (screamingly fast) and compression efficiency (results vary slightly depending on source material).
- Perhaps the most frustrating facet is the blithe ignorance about ALAC’s current open source status. While this event simply added an official “open source” status to the codec, ALAC has effectively been open source for a very long time. According to my notes, the ALAC decoding algorithm was reverse engineered in 2005 and added into FFmpeg in March of the same year. Then in 2008, Google — through their Summer of Code program — sponsored an open source ALAC encoder.
From the multimedia-savvy who are versed in these concepts, the conversation revolves around which would win in a fight, ALAC or FLAC? And who between Apple and FFmpeg/Libav has a faster ALAC decoder? The faster and more efficient ALAC encoder? I contend that these issues don’t really matter. If you have any experience working with lossless audio encoders, you know that they tend to be ridiculously fast to both encode and decode and that many different lossless codecs compress at roughly the same ratios.
As for which encoder is the fastest: use whatever encoder is handiest and most familiar, either iTunes or FFmpeg/Libav.
As for whether to use FLAC or ALAC — if you’ve already been using one or the other for years, keep on using it. Support isn’t going to vanish. If you’re deciding which to use for a new project, again, perhaps choose based on software you’re already familiar with. Also, consider hardware support– ALAC enjoys iPod support, FLAC is probably better supported in a variety of non-iPod devices, though that may change going forward due to this open sourcing event.
For my part, I’m just ecstatic that the question of moral superiority based on open source status has been removed from the equation.
Code-wise, I’m interested in studying the official ALAC code to see if it has any corner-case modes that the existing open source decoders don’t yet account for. The source makes mention of multichannel (i.e., greater than stereo) configurations, but I don’t know if that’s in FFmpeg/Libav.