简体   繁体   English

如何查看 Android 设备是否支持杜比数字?

[英]How do I check whether and Android device supports Dolby Digital?

Is there an API on android to check if a device supports DolbyDigtal(AC3) ? android 上是否有 API 来检查设备是否支持DolbyDigtal(AC3)

Is there any other way, besides using AudioManager.getReportedSurroundFormats() (which isn't listed in the official documentation ?除了使用AudioManager.getReportedSurroundFormats()官方文档中未列出之外,还有其他方法吗?

Refer to documentation that audio format for Dolby Digital is AudioFormat.ENCODING_AC3 .请参阅 Dolby Digital 的音频格式为AudioFormat.ENCODING_AC3的文档。 So you can check Dolby Digital supported from available audio output in your device like this.因此,您可以像这样检查设备中可用音频 output 支持的杜比数字。

val audioManager: AudioManager = /* ... */
val audioDeviceInfos = audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)
    .filter { it.encodings.contains(AudioFormat.ENCODING_AC3) }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM