自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
多區音訊
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如要進一步瞭解如何在汽車後座娛樂系統中使用多區域音訊,請參閱「多區域音訊」。
裝置製造商可以將螢幕連結至車輛的音訊區域。舉例來說,如果車輛有一個主要區域和後座娛樂區域,裝置製造商可以在供應商分區中採用下列設定:
<?xml version="1.0" encoding="utf-8"?>
<carAudioConfigurations xmlns:car="http://schemas.android.com/apk/res-auto">
<zones>
<zone name="primary zone">
<volumeGroups>
<group>
<device address="bus001_media">
<context context="music"/>
</device>
<device address="bus002_others">
...
</device>
</group>
</volumeGroups>
<displays>
<display car:display="<display-id-1>" />
</displays>
</zone>
<zone name="rear seat">
<volumeGroups>
<group>
<device address="bus100_all">
...
</device>
</group>
</volumeGroups>
<displays>
<display car:display="<display-id-2>" />
</displays>
</zone>
</zones>
</carAudioConfigurations>
</xml>
|
CarAudioService
會剖析這個設定檔,並在開機時根據音訊內容 (或音訊用途) 設定音訊路由。在執行階段期間,CarAudioService
會進一步偵測應用程式啟動事件,並根據 UID 將應用程式動態指派至區域。
實作
如要瞭解裝置製造商可在設定檔中加入的穩定 ID,請參閱「靜態顯示 ID」。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Multi-zone audio\n\nTo learn more about the use of multi-zone audio in automotive rear-seat entertainment systems,\nsee [Multi-Zone Audio](/docs/devices/automotive/audio#multi-zone).\n\nDevice manufacturers can link a display to an audio zone in a vehicle. For instance, for a car\nwith one primary and rear seat entertainment zone, a device manufacturer can have the following\nconfiguration on the vendor partition:\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ```carbon \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e \u003ccarAudioConfigurations xmlns:car=\"http://schemas.android.com/apk/res-auto\"\u003e \u003czones\u003e \u003czone name=\"primary zone\"\u003e \u003cvolumeGroups\u003e \u003cgroup\u003e \u003cdevice address=\"bus001_media\"\u003e \u003ccontext context=\"music\"/\u003e \u003c/device\u003e \u003cdevice address=\"bus002_others\"\u003e ... \u003c/device\u003e \u003c/group\u003e \u003c/volumeGroups\u003e \u003cdisplays\u003e \u003cdisplay car:display=\"\u003cdisplay-id-1\u003e\" /\u003e \u003c/displays\u003e \u003c/zone\u003e \u003czone name=\"rear seat\"\u003e \u003cvolumeGroups\u003e \u003cgroup\u003e \u003cdevice address=\"bus100_all\"\u003e ... \u003c/device\u003e \u003c/group\u003e \u003c/volumeGroups\u003e \u003cdisplays\u003e \u003cdisplay car:display=\"\u003cdisplay-id-2\u003e\" /\u003e \u003c/displays\u003e \u003c/zone\u003e \u003c/zones\u003e \u003c/carAudioConfigurations\u003e \u003c/xml\u003e ``` |\n\n`CarAudioService` parses this configuration file and sets up the\naudio routing by its audio context (or audio usage) at boot time. During\nruntime, `CarAudioService` further detects an app launch event and dynamically\nassigns the app to the zone based on UID.\n\nImplementation\n--------------\n\nFor the stable ID that device manufacturers can include in their configuration\nfile, see\n[Static display identifiers](/docs/core/display/multi_display/displays#static)."]]