Apple Lossless (ALAC)
Apple Lossless is a lossless codec that preserves supported PCM audio and is commonly stored in M4A files.
An M4A file can contain Apple Lossless (ALAC) instead of AAC. Its audio remains reversibly compressed PCM; the shared extension supplies an audio-file convention, while the track's “alac” identifier selects the actual codec.
Apple publishes its reference implementation and configuration description.
Sample precision, layout, and frame-length configuration
| Configuration item | Purpose |
|---|---|
| Sample rate | Places decoded sample frames on the timeline |
| Bit depth | Defines the preserved integer sample precision |
| Channel count and layout | Identify the presentation's signals and roles |
| Frame length | Describes the coding packet's sample-frame arrangement |
| Other codec parameters | Supply the decoder's defined reconstruction setup |
The reference codec supports 16-, 20-, 24-, and 32-bit integer precision and supported layouts from one to eight channels. Apple's example conversion utility accepts a narrower selection of inputs than the full codec.
Connect packet size to audio time
For illustration, an ALAC configuration can use a 4,096-sample-frame packet length. At 44.1 kHz, a full packet spans 4,096/44,100 ≈ 92.88 ms.
The uncompressed payload for 24-bit stereo over that span would be 4,096 × 2 × 3 = 24,576 bytes. ALAC's actual encoded packet size depends on the audio and compression; its duration comes from sample frames, not from dividing by an assumed compressed bitrate. A final packet can contain fewer frames.
The decoder uses the configuration and coded packet information to restore the intended values and count. That makes both codec setup and packet timing relevant when moving ALAC between M4A and CAF arrangements.
Convert the represented audio
A supported FLAC-to-ALAC conversion can reconstruct the same integer PCM and encode it reversibly again. Compare decoded sample values, count, rate, and channel order when verifying preservation; the compressed bytes and outer tags will differ.
An AAC-to-ALAC conversion instead preserves AAC's decoded approximation. The source entering the lossless encoder determines what can be restored.
For an Emby M4A collection, the alac versus AAC identification consequently answers a real decoder and preservation question. It is more useful than interpreting the filename suffix as one fixed compression type.