自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
USB 耳機:配件規格
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本文件說明瞭 USB 耳機的部分特徵,讓這些耳機在 Android 生態系統中一致運作。僅限具備數位 USB 音訊介面的耳機。根據 USB Type-C 規格,純粹類比耳機若採用與 USB-C 相容的機械式轉接頭,則不符合規定。
本文件會說明最低要求:建議配件製造商在新增功能時,務必留意這些規定。
功能總覽
USB 耳機可實作各種基本和進階功能。本規格僅涵蓋下列規定的基本功能:
- 立體聲輸出
- 選用 (但建議使用) 麥克風
- 用於控制音量、播放和通話的功能按鈕
USB 音訊類別終端類型
耳機和耳罩式耳機必須回報下列 USB 音訊類別 (UAC) 終端類型:
- 耳機:低阻抗轉換器 (小於 100 歐姆),沒有麥克風:0x0302
- 耳機。低阻抗轉換器 (含麥克風):0x0402
控制功能
耳機可能會提供不同數量的按鈕,用於控制特定功能,例如音量和播放/暫停。
控制函式 |
配件支援 |
說明 |
A |
必填 |
播放/暫停 (短按)、啟動語音指令 (長按)、下一首 (雙擊) |
B |
選用 |
Vol+ |
C |
選用 |
Vol- |
D |
選用 |
啟動語音指令 |
將按鈕指派給以下函式:
- 所有單鍵式耳機都必須實作功能 A。
- 具有多個按鈕的耳機必須依照下列模式實作功能:
- 2 個函式:A 和 D
- 3 個函式:A、B、C
- 4 個函式:A、B、C、D
注意:不允許使用鎖定鍵。使用者每次按下按鍵時,都必須產生對應的「down」和「up」按鍵事件,以便與使用者動作相符。換句話說,函式 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 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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/)."]]