自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
电台调谐器
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
构建电台应用时,我们建议您使用 HwAudioSource
,因为它既能创建补丁,又能创建媒体会话来处理媒体按键事件。可以针对相同的来源和音频属性创建多个音频源。这样一来,您便可以将一个音频源用于常规电台,而将另一个音频源用于路况通知。
如果录制 FM_TUNER
,则在 Android 11 中,执行此操作的权限曾更改为 android.permission.CAPTURE_AUDIO_OUTPUT
。它不再执行 OP_RECORD_AUDIO
权限检查,该检查仅适用于麦克风。这对应用没有任何影响,因为 FM_TUNER
已请求 SYSTEM_API
访问权限。
如需详细了解如何构建电台应用,请参阅实现电台功能。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Radio Tuner\n\nWhen building a radio app, we recommend you use the\n`HwAudioSource` as it creates the patch as well as\na media session to handle media key events. Multiple audio sources can be created\nfor the same source and audio attributes. It's possible to have one for regular\nradio usage and a second for traffic announcements.\n\nIf recording the `FM_TUNER`, in Android 11 the permission for doing so\nwas changed to `android.permission.CAPTURE_AUDIO_OUTPUT`. It\nno longer performs an `OP_RECORD_AUDIO` permission check, which applies\nto microphones only. This has no impact on apps as `FM_TUNER` already required\nthe `SYSTEM_API` permission to access.\n\nSee [Implement Radio](/docs/automotive/broadcast-radio)\nfor more details on building a radio app."]]