自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
USB 耳机:配件规范
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本文档详细说明了 USB 耳机的一些特性,使其在整个 Android 生态系统中保持一致。只允许制造带数字 USB 音频接口的耳机。根据 USB-C 型规范,不允许制造带 USB-C 型转接头的纯模拟耳机。
本文档给出的是最低要求,我们鼓励配件制造商在满足这些要求的基础上添加新的功能。
功能概览
USB 耳机可以实现多种基本功能和高级功能。本规范只涵盖必要的基本功能:
- 立体声输出
- 麦克风(可选,但建议支持)
- 用于控制音量、播放和通话的功能按钮
USB 音频类终端类型
头戴式耳机和耳机必须报告这些 USB 音频类 (UAC) 终端类型:
- 头戴式耳机。低阻抗换能器,< 100 欧,无麦克风:0x0302
- 耳机。带麦克风的低阻抗换能器:0x0402
控制功能
耳机可以带有不同数量的按钮以控制特定功能(例如音量和播放/暂停)。
控制功能 |
配件支持 |
说明 |
A |
必需 |
播放/暂停(短按)、启动语音命令(长按)、下一曲(按两下) |
B |
可选 |
调高音量 |
C |
可选 |
Vol- |
D |
可选 |
启动语音指令 |
按钮功能分配如下:
- 所有单按钮耳机都必须实现功能 A。
- 多按钮耳机必须按照以下模式实现相应功能:
- 2 项功能:A 和 D
- 3 项功能:A、B、C
- 4 项功能:A、B、C、D
注意:不允许按键锁定。最终用户每次按键时都必须生成相应的“按下”和“释放”按键事件,与最终用户的操作相匹配。换句话说,功能 A 到功能 D 所对应的按键一律不能被“锁定”,也不能用作切换开关(在这种情况下,当生成“按下”按键事件后,第二次按下按键时才会生成“释放”按键事件)。
软件映射
兼容的 USB 耳机需要支持耳机按钮的以下软件映射。设备会将这些 HID 映射与相应的 Android 键码相匹配。
函数 |
映射 |
A |
HID 用途页:0x0C
HID 用途:0x0CD |
B |
HID 用途页:0x0C
HID 用途:0x0E9 |
C |
HID 用途页:0x0C
HID 用途:0x0EA |
D |
HID 用途页:0x0C
HID 用途:0x0CF |
按键映射应在 HID 应用集合中声明。对于不带麦克风的配件,请使用耳机(用途页:消费者 (0x0C),用途:耳机 (0x05))。对于带有麦克风的配件,请使用耳麦(用途页:电话 (0x0B),用途:耳麦 (0x05))。
输出级别
声压级上限应符合目的地国家/地区的所有监管要求。
机械
配件制造商必须遵循 USB.org 中对 USB 连接器的要求。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# USB headset: Accessory specification\n\nThis documentation specifies some characteristics of USB headsets, so that\nthey function uniformly across the Android ecosystem. Only headsets with\ndigital USB audio interface are permitted. Purely analog headsets with\nmechanical adaptation to USB-C are not permitted, as per USB Type-C\nspecification.\n\n\nThis documentation specifies the minimum requirements: accessory manufacturers\nare encouraged to add features while keeping these requirements in mind.\n\nFunctional overview\n-------------------\n\n\nUSB headsets can implement a variety of basic and advanced features. This\nspecification only covers mandated basic features:\n\n- Stereo output\n- Optional, but recommended, microphone\n- Function buttons for volume, playback, and call control\n\nUSB Audio Class terminal types\n------------------------------\n\n\nHeadphones and headsets must report these USB Audio Class (UAC) terminal types:\n\n- **Headphones**. Low impedance transducers, \\\u003c 100 ohms, no microphone: 0x0302\n- **Headset**. Low impedance transducers with microphone: 0x0402\n\nControl functions\n-----------------\n\nHeadsets can come with varying number of buttons to control specific\nfunctions, such as volume and play/pause.\n\n\n| Control function | Accessory Support | Description |\n|------------------|-------------------|----------------------------------------------------------------------------------|\n| A | Required | Play/pause (short press), launch voice command (long press), next (double press) |\n| B | Optional | Vol+ |\n| C | Optional | Vol- |\n| D | Optional | Launch voice command |\n\n\n**Assign functions to buttons as follows:**\n\n- All one-button headsets must implement Function A.\n- Headsets with multiple buttons must implement functions according to the following pattern:\n - 2 functions: A and D\n - 3 functions: A, B, C\n - 4 functions: A, B, C, D\n\n\n**Note**: No key latching allowed. Each key press by the end user\nmust generate the corresponding \"down\" and \"up\" key event, matching the end user\naction. In other words, the keys for functions A through D are never \"latched\"\nor implemented to be used as a toggle (where the \"up\" event only follows \"down\"\non a second key press).\n\nSoftware mapping\n----------------\n\n\nCompatible USB headsets are required to support the following software mappings\nfor the headset buttons. Devices match these HID mappings with the appropriate\nAndroid keycode.\n\n| Function | Mappings |\n|----------|---------------------------------------|\n| A | HID usage page: 0x0C HID usage: 0x0CD |\n| B | HID usage page: 0x0C HID usage: 0x0E9 |\n| C | HID usage page: 0x0C HID usage: 0x0EA |\n| D | HID usage page: 0x0C HID usage: 0x0CF |\n\nKey mappings should be declared within a HID application\ncollection. For accessories without a microphone, use Headphone (Usage\nPage: Consumer (0x0C), Usage: Headphone (0x05)). For accesories with a\nmicrophone, use Headset (Usage Page: Telephony (0x0B), Usage: Headset (0x05)).\n\nOutput level\n------------\n\n\nThe maximum sound pressure level shall comply to any regulatory requirement in\nthe country of destination.\n\nMechanical\n----------\n\n\nAccessory manufacturers must follow the requirements for USB connectors\nas specified by [USB.org](http://www.usb.org/)."]]