透過集合功能整理內容
你可以依據偏好儲存及分類內容。
可聽式裝置控制
快速配對的智慧耳機控制項旨在為 Android 裝置提供更完善的存取控制選項,方便使用者操作重要的智慧耳機功能。為此,我們在「Message Stream」中新增了「Hearable controls」訊息群組。
主動噪音控制
主動噪音控制功能已成為高階耳機的熱門功能。在 Seeker 端,快速配對會提供 UI 和邏輯,用於設定、取得及儲存狀態,而狀態會儲存在 Provider 端。事件串流連線時,供應商必須傳送工作階段隨機值。為達成這個目的,系統定義了下列訊息代碼:
訊息產品代號 |
值 |
寄件者 |
作答者 |
MAC |
ACK |
取得 ANC 狀態 |
0x11 |
Seeker |
供應商 |
否 |
否 |
設定 ANC 狀態 |
0x12 |
Seeker |
供應商 |
是 |
是 |
通知 ANC 狀態 |
0x13 |
供應商 |
Seeker |
否 |
否 |
當 Seeker 連線至 Provider,或 Provider 收到「Get ANC state」訊息時,Provider 可以通知 ANC 狀態,讓 Seeker 瞭解 ANC 功能和儲存的狀態。訊息如下:
Byte |
資料類型 |
說明 |
值 |
0 |
uint8 |
可聽式裝置控制 |
0x08 |
1 |
uint8 |
通知 ANC 狀態 |
0x13 |
2 - 3 |
uint16 |
額外資料長度 |
0x04 |
4 - 7 |
|
ANC 控制資料 |
因人而異 |
ANC 控制資料
Byte |
資料類型 |
說明 |
值 |
0 |
uint8 |
版本代碼 |
因版本而異,0x02 (適用於這個版本) |
1 |
旗幟 |
UI 切換開關 每個模式會根據其旗標位元的值啟用 (1) 或停用 (0),如下所示: 位元 0 (MSB):透明 位元 1:自動調整 (或 0,如果系統不支援) 位元 2:關閉 位元 3:保留 (將位元設為 0) 位元 4:ANC |
因人而異 |
2 |
旗幟 |
可設定的切換按鈕 您也可以在這裡設定上述任何或所有 UI 切換位元,指出目前啟用的位元。 |
因人而異 |
3 |
旗幟 |
目前狀態 只能設定一個位元,且這個位元組的值不得為零。 |
因人而異 |
Seeker 會根據 ANC 控制資料顯示切換 UI。
範例 1:供應商支援 3 向 ANC:透明 - 關閉 - ANC,且耳機戴在頭上,所有模式現在都可設定,目前狀態為關閉:
Byte |
資料類型 |
說明 |
值 |
0 |
uint8 |
版本代碼 |
0x01 |
1 |
旗幟 |
UI 切換按鈕 |
0b10101000 |
2 |
旗幟 |
可設定的切換按鈕 |
0b10101000 |
3 |
旗幟 |
目前狀態 |
0b00100000 |
範例 2:供應商支援 3 向 ANC:透明 - 關閉 - ANC,現在只有一個耳機戴在頭上,或沒有耳機戴在頭上,因此無法設定任何模式,目前狀態為關閉:
Byte |
資料類型 |
說明 |
值 |
0 |
uint8 |
版本代碼 |
0x01 |
1 |
旗幟 |
UI 切換 |
0b10101000 |
2 |
旗幟 |
可設定的切換鈕 |
0b00000000 |
3 |
旗幟 |
目前狀態 |
0b00100000 |
如果使用者切換切換鈕,Seeker 會將目前狀態設為 Provider,如下所示:
Byte |
資料類型 |
說明 |
值 |
0 |
uint8 |
可聽式裝置控制 |
0x08 |
1 |
uint8 |
設定 ANC 狀態 |
0x12 |
2 - 3 |
uint16 |
額外資料長度 |
因情況而異、0x04 或 0x14 |
4 |
uint8 |
Seeker 版本代碼 |
不一,0x01 或 0x02 |
5 |
旗幟 |
可設定的 ANC 模式 (UI 切換) |
因人而異 |
6 |
旗幟 |
已啟用主動降噪模式 (可設定切換) |
因人而異 |
7 |
旗幟 |
新的 ANC 模式索引 (新狀態) |
因人而異 |
8 - 23 |
|
預留 |
因人而異 |
第 4 到第 7 個位元組實際上是從 Seeker 端傳送的 ANC 控制資料。如果額外長度值設為 0x14,系統會提供保留的位元組 8-23,但供應商收到這些位元組時應忽略。如果額外長度值設為 0x04,則沒有保留的位元組。
當供應商收到「設定 ANC 狀態」訊息時,應確認,並通知所有已連線的搜尋者 ANC 狀態。如果使用者透過頭戴式裝置手勢或隨附應用程式變更設定,Provider 也應將通知傳送給所有已連線的 Seeker。
範例 3:供應商支援 4 向 ANC:透明 - 自動調整 - 關閉 - ANC,耳機戴在頭上,所有模式現在都可設定,目前狀態為自動調整:
Byte |
資料類型 |
說明 |
值 |
0 |
uint8 |
版本代碼 |
0x01 |
1 |
旗幟 |
UI 切換 |
0b11101000 |
2 |
旗幟 |
可設定的切換鈕 |
0b11101000 |
3 |
旗幟 |
目前狀態 |
0b01000000 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-28 (世界標準時間)。
[null,null,["上次更新時間:2025-08-28 (世界標準時間)。"],[[["\u003cp\u003eHearable Controls utilize Message Stream to enhance access to headphone features on Android.\u003c/p\u003e\n"],["\u003cp\u003eActive Noise Control (ANC) functionality allows for setting, retrieving, and saving noise cancellation preferences.\u003c/p\u003e\n"],["\u003cp\u003eANC state is communicated between devices, allowing the user interface to reflect available and current noise control modes.\u003c/p\u003e\n"],["\u003cp\u003eANC state can be controlled by the user via device UI and is synchronized across connected devices through notifications.\u003c/p\u003e\n"]]],["Hearable controls are added within the Message Stream for better access to hearable features. Active Noise Control (ANC) functionality is implemented, allowing the Seeker to get, set, and save the ANC state, which is stored by the Provider. The Provider can notify the Seeker of ANC capabilities and stored state. UI toggles for ANC are managed via flags, including transparent, off, and ANC modes. The Seeker sends a \"Set ANC state\" message to update the current ANC mode. The Provider must acknowledge these messages and notify connected Seekers.\n"],null,["Hearable Controls\n\nHearable controls on Fast Pair aim to provide better access controls for\nimportant Hearable features on Android. A new message group Hearable\ncontrols inside [Message Stream](/nearby/fast-pair/specifications/extensions/messagestream#MessageStream \"Message Stream\") has been added to achieve this.\n\n| Message Group Name | Value |\n|--------------------|-------|\n| Hearable control | 0x08 |\n\nActive noise control\n\nActive noise control is becoming a prominent feature for premium headphones. On\nthe Seeker side, Fast Pair will have the UI and logic to set, get and save the\nstate, and the state will be stored on the Provider side.\nIt is mandatory for provider to send [Session Nonce](/nearby/fast-pair/specifications/extensions/mac#SessionAndMessageNonce \"Session Nonce\") when event\nstream is connected.\nTo achieve this, below message codes are defined:\n\n| Message Code Name | Value | Sender | Responder | MAC | ACK |\n|-------------------|-------|----------|-----------|-----|-----|\n| Get ANC state | 0x11 | Seeker | Provider | N | N |\n| Set ANC state | 0x12 | Seeker | Provider | Y | Y |\n| Notify ANC state | 0x13 | Provider | Seeker | N | N |\n\nWhen a Seeker connects to a Provider, or when a Provider receives a \"Get ANC\nstate\" message, the Provider\ncan Notify the ANC state to let the Seeker know its ANC capability and its\nstored state. The message is as follow:\n\n| Byte | Data Type | Description | Value |\n|-------|-----------|-------------------------------------|----------|\n| 0 | uint8 | Hearable control | 0x08 |\n| 1 | uint8 | Notify ANC state | 0x13 |\n| 2 - 3 | uint16 | Additional data length | 0x04 |\n| 4 - 7 | | [ANC control data](#ANCControlData) | *varies* |\n\nANC control data\n\n| Byte | Data Type | Description | Value |\n|------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|\n| 0 | uint8 | Version code | *varies*, 0x02 for this version |\n| 1 | Flags | UI toggles Each mode is enabled (1) or disabled (0) according to the value of its flag bit, as follows: Bit 0 (MSB): transparent Bit 1: adaptive (or 0 if it is not supported) Bit 2: off Bit 3: Reserved (Set bit to 0) Bit 4: ANC | *varies* |\n| 2 | Flags | Settable toggles Any or all of the UI toggle bits above may also be set here, to indicate which are currently enabled. | *varies* |\n| 3 | Flags | Current state Only one bit can be set and value of this byte shall be non zero. | *varies* |\n\nThe Seeker will show the toggle UI according to the ANC control data.\n\nExample 1: The Provider supports 3-way ANC: transparent - off - ANC \\& buds are\non-head, all modes are settable now, and current state is off:\n\n| Byte | Data Type | Description | Value |\n|------|-----------|------------------|------------|\n| 0 | uint8 | Version code | 0x01 |\n| 1 | Flags | UI toggles | 0b10101000 |\n| 2 | Flags | Settable toggles | 0b10101000 |\n| 3 | Flags | Current state | 0b00100000 |\n\nExample 2: The Provider supports 3-way ANC: transparent - off - ANC, only one\nbud is on-head now or no buds is on-head, so no modes are settable, and the\ncurrent state is off:\n\n| Byte | Data Type | Description | Value |\n|------|-----------|-----------------|------------|\n| 0 | uint8 | Version code | 0x01 |\n| 1 | Flags | UI toggle | 0b10101000 |\n| 2 | Flags | Settable toggle | 0b00000000 |\n| 3 | Flags | Current state | 0b00100000 |\n\nIf the user switches the toggle, the Seeker will set the current state to the\nProvider as follow:\n\n| Byte | Data Type | Description | Value |\n|--------|-----------|-------------------------------------|------------------------|\n| 0 | uint8 | Hearable control | 0x08 |\n| 1 | uint8 | Set ANC state | 0x12 |\n| 2 - 3 | uint16 | Additional data length | *varies*, 0x04 or 0x14 |\n| 4 | uint8 | Seeker Version code | *varies*, 0x01 or 0x02 |\n| 5 | Flags | ANC Settable modes (UI toggle) | *varies* |\n| 6 | Flags | ANC Enabled modes (Settable toggle) | *varies* |\n| 7 | Flags | New ANC mode index (New state) | *varies* |\n| 8 - 23 | | Reserved | *varies* |\n\nThe byte 4 - 7 is actually [ANC control data](#ANCControlData) sent from\nSeeker side. If additional length value is set as 0x14, the reserved bytes 8-23\nwould be present and on receipt of these bytes, the provider should ignore them.\nIf additional length value is set as 0x04, there are no reserved bytes present.\n\nWhen a Provider receives a \"Set ANC state\" message, it should [Acknowledge](/nearby/fast-pair/specifications/extensions/acknowledgement#MessageStreamAcknowledgements \"Message Stream Acknowledgements\"),\nand Notify ANC state to all connected Seekers.\nIf the user changes the setting via headset gesture or companion application,\nthe Provider should also send notification to all connected Seekers.\n\nExample 3: The Provider supports 4-way ANC: transparent - adaptive - off - ANC,\nbuds are on-head, all modes are settable now, and current state is adaptive:\n\n| Byte | Data Type | Description | Value |\n|------|-----------|-----------------|------------|\n| 0 | uint8 | Version code | 0x01 |\n| 1 | Flags | UI toggle | 0b11101000 |\n| 2 | Flags | Settable toggle | 0b11101000 |\n| 3 | Flags | Current state | 0b01000000 |"]]