Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Âm thanh nhiều vùng
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Để tìm hiểu thêm về cách sử dụng âm thanh nhiều vùng trong hệ thống giải trí cho hàng ghế sau của ô tô, hãy xem phần Âm thanh nhiều vùng.
Nhà sản xuất thiết bị có thể liên kết màn hình với một vùng âm thanh trong xe. Ví dụ: đối với một ô tô có một khu giải trí chính và khu giải trí ở ghế sau, nhà sản xuất thiết bị có thể có cấu hình sau trên phân vùng của nhà cung cấp:
<?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
phân tích cú pháp tệp cấu hình này và thiết lập việc định tuyến âm thanh theo ngữ cảnh âm thanh (hoặc mức sử dụng âm thanh) tại thời điểm khởi động. Trong thời gian chạy, CarAudioService
sẽ phát hiện thêm một sự kiện khởi chạy ứng dụng và tự động gán ứng dụng đó cho vùng dựa trên UID.
Triển khai
Đối với mã nhận dạng ổn định mà nhà sản xuất thiết bị có thể đưa vào tệp cấu hình, hãy xem phần Mã nhận dạng màn hình tĩnh.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],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)."]]