高性能音频
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通常,高性能音频应用所需的不仅仅是简单的声音播放或录制功能。它们需要响应式实时系统行为。一些典型用例包括:
数字音频工作站
合成器
电子鼓
音乐学习应用
卡拉 OK 应用
DJ 混音
音效
视频/音频会议
本部分介绍了最大限度缩短音频延迟 的一般原则。此外,本部分还提供了音频采样建议 ,以帮助您选择最佳采样率,以及考虑使用浮点数表示音频数据的优缺点。
本部分余下的内容介绍了两个可用于编写高性能音频应用的库:
OpenSL ES 是 Khronos Group 开发的 OpenSL ES™ API 规范的实现,专用于 Android。我们不推荐将 OpenSL ES 用于新品设计。应用开发者和中间件提供商应将 Oboe 或 AAudio 用作原生音频接口。
AAudio 是 OpenSL ES 库的轻量级原生 Android 替代项。与 OpenSL ES 相比,AAudio API 不仅更小,而且更易于使用。
注意 :开发者应考虑使用开源 Oboe 库,这个库可在 GitHub 上获得。Oboe 是一个 C++ 封装容器,提供与 AAudio 非常相似的 API。该封装容器在 AAudio 可用时对其进行调用,并在 AAudio 不可用时回退到 OpenSL ES。
其他资源
要了解详情,请参考以下资源:
示例
Codelab
视频
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-11-01 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]