自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
“音频设备”面板
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
许多 CTS 验证程序的音频测试会在各种音频硬件设备上验证功能。音频设备面板会指明哪些音频设备受 DUT 支持以及哪些音频设备可供使用。
支持的设备列表显示了可供 DUT 使用但因未必已连接而在测试时不可用的音频设备。AudioManager.getSupportedDeviceTypes()
(已在 SDK 35 中添加)用于返回支持的设备类型。
下图显示了 DUT 支持的内置设备(例如麦克风、扬声器和手机听筒)、模拟音频外围设备、蓝牙音频外围设备和 USB 音频外围设备:
图 1. “音频设备”面板,显示了“支持的设备”列表。
可用的设备列表显示了可在测试时使用的音频设备,这些设备要么是内置在 DUT 中(例如内部扬声器和麦克风),要么是已连接的设备(例如模拟耳机或 USB 音频外围设备)。
下图显示,只有内置设备可供使用,即没有任何外部音频外围设备连接到 DUT:
图 2. “音频设备”面板,显示了“可用的设备”列表。
如果“支持的设备”列表与设备内置硬件(输入)不匹配,则意味着 HAL 提供的音频政策配置可能存在问题。如果可用的设备与设备所连装置(输出)不匹配,则意味着底层音频软件层可能存在问题。
将音频外围设备连接到 DUT 后,系统会更新“可用的设备”列表以反映配置变更。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-05-08。
[[["易于理解","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"]],["最后更新时间 (UTC):2025-05-08。"],[],[],null,["# Audio Devices panel\n\n\u003cbr /\u003e\n\nMany CTS Verifier audio tests validate capabilities over a variety of audio\nhardware devices. The **Audio Devices** panel indicates which audio devices are\nsupported by the DUT and which are available for use.\n\nThe **Supported Devices** list shows audio devices that the DUT can use, but\naren't necessarily connected and hence aren't available at testing time.\n[`AudioManager.getSupportedDeviceTypes()`](https://developer.android.com/reference/android/media/AudioManager#getSupportedDeviceTypes(int)),\nadded in SDK 35, returns supported device types.\n\nThe following figure shows that the DUT supports the built-in\ndevices (such as microphone, speaker, and earpiece), analog audio peripherals,\nBluetooth audio peripherals, and USB audio peripherals:\n\n**Figure 1.** Audio Devices panel showing supported devices.\n\nThe **Available Devices** list shows audio devices that can be used at testing\ntime, either because they're built in to the DUT (such as the internal speaker\nand microphone), or are connected (such as an analog headset or USB audio\nperipheral).\n\nThe following figure shows that only the built-in devices are available for use,\nthat is, there are no external audio peripherals connected to the DUT:\n\n**Figure 2.** Audio Devices panel showing available devices.\n\nIf the list of supported devices doesn't match the hardware that is in\nthe device (**Inputs** ), there might be a problem in the audio policy\nconfiguration provided by the HAL. If the available devices don't match what is\nconnected to the device (**Outputs**), there might be a problem with the\nunderlying audio software layer.\n\nWhen audio peripherals are connected to the DUT, the list of available devices\nis updated to reflect the configuration."]]