Apple Lossless, also known as Apple Lossless Audio Codec, or Apple Lossless Encoder, is an audio coding format, and its reference audio codec implementation, developed by Apple Inc. for lossless data compression of digital music. After initially keeping it proprietary from its inception in 2004, in late 2011 Apple made the codec available open source and royalty-free. Traditionally, Apple has referred to the codec as Apple Lossless, though more recently it has begun to use the abbreviated term ALAC when referring to the codec.
Codec
Apple Lossless supports up to 8 channels of audio at 16, 20, 24 and 32 bit depth with a maximum sample rate of 384kHz. Apple Lossless data is frequently stored within an MP4container with the filename extension.m4a. This extension is also used by Apple for lossy AACaudio data in an MP4 container. However, Apple Lossless is not a variant of AAC, but rather a distinct lossless format that uses linear prediction similar to other lossless codecs. These other lossless codecs, such as FLAC and Shorten, are not natively supported by Apple's iTunes nor the later Music applications or by older iOS devices, but there are free converter tools available to change the format from FLAC to ALAC or vice versa. More modern devices such as the iPhone 7 and above, running iOS11, support FLAC playback, but not inside the iTunes or Music applications. Users of iTunes or Music applications who want to use a lossless format which allows the addition of metadata have to use ALAC. All current iOS devices can play ALAC–encoded files. ALAC also does not use any DRM scheme; but by the nature of the MP4 container, it is feasible that DRM could be applied to ALAC much in the same way it is applied to files in other QuickTime containers. According to Apple, audio files compressed with its lossless codec will use up "about half the storage space" that the uncompressed data would require. Testers using a selection of music have found that compressed files are about 40% to 60% the size of the originals depending on the kind of music, which is similar to other lossless formats. Furthermore, compared to some other formats, it is not as difficult to decode, making it practical for a limited-power device, such as older iOS devices. Partly because of the use of an MP4 container, Apple Lossless does not contain integrated error checking. While not nearly as common, the ALAC format can also use the.CAF file type container.
History
The data compression software for encoding into ALAC files, Apple Lossless Encoder, was introduced into the Mac OS XCore Audio framework on April 28, 2004 together with the QuickTime 6.5.1 update, thus making it available in iTunes since version 4.5 and above, and its replacement, the Music application. The codec is also used in the AirPort and AirPlay implementation. The Apple Lossless Encoder were released as open source software under the Apache License version 2.0 on October 27, 2011; however, an independent reverse-engineered open-source encoder and decoder were already available before the release.
Other players
David Hammerton and Cody Brocious have analyzed and decoded this codec without any documents on the format. On March 5, 2005, Hammerton published a simple open source decoder written in the C programming language on the basis of the reverse engineering work. The open source library libavcodec incorporates both a decoder and an encoder for the Apple Lossless format, which means that :Category:Software that uses FFmpeg|media players based on that library are able to play Apple Lossless files. Windows 10 supports ALAC encoding and decoding since 2015, thereby enabling other media players to use it, e.g. Windows Media Player when ripping CDs or the Spotify desktop client for playback of local.m4a files. The library was subsequently optimized for ARM processors and included in Rockbox. Foobar2000 will also play Apple Lossless files as will JRiver Media Center and BitPerfect.