# 苹果无损音频编解码器

**苹果无损音频编解码器**（Apple Lossless Audio Codec，ALAC）是由[苹果公司](https://www.edgepedia.org/zh/apple-inc)（Apple Inc.）开发的一种无损音频压缩格式，于2004年随iTunes 4.5一同推出。它能在不丢弃任何数据的前提下压缩PCM音频数据，因此解码后的ALAC文件能精确还原原始采样，也是苹果用来以无损质量提供整个Apple Music曲库的编解码器，分辨率从16位/44.1 kHz直至24位/192 kHz。<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup><sup> • </sup><sup>[2](https://support.apple.com/guide/iphone/play-lossless-audio-iph14e213417/27/ios/27)</sup>

| 关键事实 | 详情 |
|---|---|
| 推出时间 | 2004年，随iTunes 4.5推出<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup> |
| 开源时间 | 2011年10月，编码器和解码器以Apache 2.0许可证发布<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup> |
| 压缩方式 | 无损；节省约50%的磁盘空间，而有损的AAC或MP3压缩比约为10:1<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup> |
| 支持的输入 | 位深16、20、24和32位；1至384,000 Hz的任意整数采样率；1至8声道<sup>[3](https://github.com/starkshaw/AppleLossless)</sup> |
| 分帧 | 默认每包4096帧以实现最大兼容性；可由编码器配置<sup>[4](https://github.com/mikebrady/alac/blob/master/ALACMagicCookieDescription.txt)</sup> |
| 容器 | 符合MPEG-4的QuickTime容器（.m4a）和Core Audio Format（CAF）；在HLS流媒体中，苹果无损必须以fMP4承载<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup><sup> • </sup><sup>[5](https://developer.apple.com/streaming/hls-authoring-specification-for-apple-devices.html)</sup> |
| Apple Music用途 | 整个曲库以ALAC编码，从16位/44.1 kHz（CD质量）直至24位/192 kHz<sup>[2](https://support.apple.com/guide/iphone/play-lossless-audio-iph14e213417/27/ios/27)</sup> |

## 用途与压缩特性

ALAC与FLAC（Free Lossless Audio Codec，免费无损音频编解码器）同属一个家族：两者都是音频领域的“zip式”压缩器，在播放时能精确重建原始PCM流，而有损格式如AAC或MP3则会永久丢弃信息。[Ars Technica](https://www.edgepedia.org/zh/ars-technica) 2011年的报道用数字说明了实际差异：有损编解码器对[音乐](https://www.edgepedia.org/zh/music-app)的压缩比通常在10:1左右，而无损的ALAC文件可节省约50%的磁盘空间。<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup>2024年一次声学会议上的比较测量显示，ALAC在其测试信号上的压缩比为7.9:1，电平分析中误差为零dB，证实解码输出与未压缩的波形文件完全一致。<sup>[6](https://www.acoustics.asn.au/conference_proceedings/AAS2024/papers/p111.pdf)</sup>

ALAC没有压缩级别。

## 技术结构

开源版本通过ALACSpecificConfig结构记录了该编解码器的配置，该结构由编码器提供，并作为“魔法饼干”（magic cookie）原样传递给解码器。其字段设定每包帧数（默认4096）、源位深（最大32）、声道数，以及用于两声道以上配置的可选声道布局信息。<sup>[4](https://github.com/mikebrady/alac/blob/master/ALACMagicCookieDescription.txt)</sup>该格式支持16、20、24和32位的位深，1至384,000 Hz的任意整数采样率（理论上可达2<sup>32</sup> − 1 Hz），以及1至8个声道。<sup>[3](https://github.com/starkshaw/AppleLossless)</sup>

**容器。** ALAC流承载于符合MPEG-4的[QuickTime](https://www.edgepedia.org/zh/quicktime)容器中，通常是.m4a文件，其中魔法饼干封装在'stsd'（声音描述）盒的AudioSampleEntry中；在Core Audio Format（CAF）文件中，它存储在'kuki'（[魔法饼干](https://www.edgepedia.org/zh/magic-cookie)）块中。<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup><sup> • </sup><sup>[4](https://github.com/mikebrady/alac/blob/master/ALACMagicCookieDescription.txt)</sup>苹果的HTTP Live Streaming制作规范将苹果无损列为支持的立体声和多声道编解码器之一，要求其使用fMP4容器，并为其分配采样条目代码'alac'。<sup>[5](https://developer.apple.com/streaming/hls-authoring-specification-for-apple-devices.html)</sup>

**苹果设备上的解码。** 在iOS上，ALAC播放可以使用硬件辅助解码，但AAC、HE-AAC、MP3和ALAC共享同一条硬件路径，因此设备通过该路径一次只能播放这些格式中的一个实例。<sup>[7](https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html)</sup>

## 历史

苹果于2004年随iTunes 4.5推出ALAC，并保持其专有状态达七年之久。独立开发者早已对该格式进行了逆向工程，并在官方发布六年前就为libavcodec添加了支持，因此当苹果于2011年10月以Apache 2.0许可证发布其参考编码器和解码器时，VLC和Boxee等开源播放器已经能够处理ALAC文件。<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup>苹果还使用ALAC通过AirPlay将音频从iTunes或iPhone传输到[AirPort Express](https://www.edgepedia.org/zh/airport-express)或Apple TV。<sup>[1](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)</sup>

**Apple Music无损。** 2021年6月，苹果将ALAC设为整个Apple Music曲库无损流媒体的传输格式，当时曲库已有超过7500万首歌曲，且不额外收费。无损层级从CD质量起步，即16位/44.1 kHz，最高至24位/48 kHz；高解析度无损层级达到24位/192 kHz，需要外部设备如USB数模转换器。<sup>[8](https://www.apple.com/nz/newsroom/2021/05/apple-music-announces-spatial-audio-and-lossless-audio/)</sup>苹果目前的说明指出，整个Apple Music曲库均使用ALAC编码，分辨率从16位/44.1 kHz直至24位/192 kHz，并且流媒体播放或下载无损音频所消耗的数据和存储空间显著多于有损替代方案。<sup>[2](https://support.apple.com/guide/iphone/play-lossless-audio-iph14e213417/27/ios/27)</sup>苹果面向供应商的Apple Digital Masters文档同样描述了使用ALAC向订阅者交付无损母带。<sup>[9](https://www.apple.com/in/apple-music/apple-digital-masters/docs/apple-digital-masters.pdf)</sup>

## 播放限制与蓝牙

无损ALAC并不能在播放链的每一环都保持无损。苹果的支持文档明确指出蓝牙连接并非无损：AirPods、[AirPods Pro](https://www.edgepedia.org/zh/airpods-pro)、AirPods Max和Beats无线耳机使用苹果AAC蓝牙编解码器，因此无线发送的ALAC流会被压缩为AAC，丢失使其无损的额外细节。<sup>[2](https://support.apple.com/guide/iphone/play-lossless-audio-iph14e213417/27/ios/27)</sup><sup> • </sup><sup>[10](https://www.whathifi.com/advice/heres-what-does-and-doesnt-support-apple-music-lossless-and-spatial-audio-and-why)</sup>在苹果耳机中，只有AirPods Max和AirPods Max 2支持无损，且仅通过有线USB-C连接，该功能由苹果于2025年推出。<sup>[10](https://www.whathifi.com/advice/heres-what-does-and-doesnt-support-apple-music-lossless-and-spatial-audio-and-why)</sup>

设备分辨率同样重要。在iPhone上，播放采样率高于48 kHz的歌曲需要外部数模转换器。<sup>[2](https://support.apple.com/guide/iphone/play-lossless-audio-iph14e213417/27/ios/27)</sup>在“音乐”应用中，无损设置允许最高24位/48 kHz的分辨率，高解析度无损允许24位/192 kHz，蜂窝流媒体、Wi-Fi流媒体和下载各有独立的质量选项。<sup>[2](https://support.apple.com/guide/iphone/play-lossless-audio-iph14e213417/27/ios/27)</sup>

## 安全历史

开源ALAC解码器成了一项安全负担。[Check Point](https://www.edgepedia.org/zh/check-point) Research于2022年报告称，共享代码自2011年以来从未修补，而苹果一直在更新其专有解码器，且两家最大的移动芯片组制造商联发科和高通已将存在漏洞的苹果提供代码移植到其OpenMAX音频解码器中。这些漏洞可通过格式错误的音频文件利用以实现远程代码执行，或由无特权的Android应用利用以实现权限提升，被分配为CVE-2021-30351（高通）以及CVE-2021-0674和CVE-2021-0675（联发科），修复程序见于2021年12月的安全公告。Check Point引用一位研究者的估计称，2021年售出的所有智能手机中有三分之二在未修补的情况下存在漏洞。<sup>[11](https://research.checkpoint.com/2022/bad-alac-one-codec-to-hack-the-whole-world/)</sup><sup> • </sup><sup>[12](https://arstechnica.com/information-technology/2022/04/critical-bug-could-have-let-hackers-commandeer-millions-of-android-devices/)</sup>

## ALAC与FLAC的比较

两种编解码器服务于重叠但不同的目的。FLAC在压缩比和非苹果设备上领先，而ALAC通过Core Audio和QuickTime集成提供苹果原生的便利性。<sup>[13](https://formats.jarhalab.com/comparisons/flac-vs-alac)</sup>解码速度也有所不同：在[Symphonia](https://www.edgepedia.org/zh/symphonia)项目44 kHz/16位的基准测试中，其Rust ALAC解码器在426.7毫秒内处理完一个测试集，而FFmpeg为586.7毫秒；FLAC解码相同素材则为190.9毫秒（Symphonia）和267.8毫秒（FFmpeg），使FLAC在该测试中的解码速度约为ALAC的两倍。<sup>[14](https://github.com/pdeljanov/Symphonia/blob/main/BENCHMARKS.md)</sup>

## References

1. [After seven years, Apple open sources its Apple Lossless Audio Codec, Ars Technica (October 28, 2011)](https://arstechnica.com/gadgets/2011/10/after-seven-years-apple-open-sources-its-apple-lossless-audio-codec/)
2. [Play lossless audio in Music on iPhone, Apple Support](https://support.apple.com/guide/iphone/play-lossless-audio-iph14e213417/27/ios/27)
3. [The Apple Lossless Format, README of the AppleLossless repository derived from alac.macosforge.org](https://github.com/starkshaw/AppleLossless)
4. [ALACMagicCookieDescription.txt, mikebrady/alac repository](https://github.com/mikebrady/alac/blob/master/ALACMagicCookieDescription.txt)
5. [HTTP Live Streaming (HLS) authoring specification for Apple devices, Apple Developer](https://developer.apple.com/streaming/hls-authoring-specification-for-apple-devices.html)
6. [Review of audio compression formats for post-processing, Acoustics 2024, Australian Acoustical Society](https://www.acoustics.asn.au/conference_proceedings/AAS2024/papers/p111.pdf)
7. [Using Audio, Apple Developer archive (Multimedia Programming Guide)](https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html)
8. [Apple Music announces Spatial Audio with Dolby Atmos; will bring Lossless Audio to entire catalog, Apple Newsroom (May 2021)](https://www.apple.com/nz/newsroom/2021/05/apple-music-announces-spatial-audio-and-lossless-audio/)
9. [Apple Digital Masters 2.4.1 (Oasis), Apple](https://www.apple.com/in/apple-music/apple-digital-masters/docs/apple-digital-masters.pdf)
10. [Apple Music Lossless: which devices do (and don't) play lossless and Spatial Audio, What Hi-Fi?](https://www.whathifi.com/advice/heres-what-does-and-doesnt-support-apple-music-lossless-and-spatial-audio-and-why)
11. [#ALHACK: One codec to hack the whole world, Check Point Research (2022)](https://research.checkpoint.com/2022/bad-alac-one-codec-to-hack-the-whole-world/)
12. [Critical bug could have let hackers commandeer millions of Android devices, Ars Technica (April 2022)](https://arstechnica.com/information-technology/2022/04/critical-bug-could-have-let-hackers-commandeer-millions-of-android-devices/)
13. [FLAC vs ALAC: Which to Use?, Jarhalab file format comparisons](https://formats.jarhalab.com/comparisons/flac-vs-alac)
14. [Symphonia BENCHMARKS.md, pdeljanov/Symphonia repository](https://github.com/pdeljanov/Symphonia/blob/main/BENCHMARKS.md)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › 数据格式与序列化 › 音频格式与编解码器

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/apple-lossless-audio-codec

English original: https://www.edgepedia.org/apple-lossless-audio-codec
