首页 > 代码库 > aaudio 1
aaudio 1
Android has long struggled with high latency for audio. Due to this, professional audio apps were never possible on the platform. Google has been trying to solve the issue since Lollipop and has made great strides on that front.
However, the audio latency still varies greatly from device to device that continues to make it difficult for developers to create professional audio apps for the platform. To tackle this issue once and for all, Google is introducing AAudio API in Android O.
This new API offers high-performance low-latency audio for apps that specifically require it. Apps that will be making use of this API will write and receive data via streams for optimal performance. Developers will be able to take advantage of this API to create professional grade audio apps for Android. The introduction of this API will also ensure wider compatibility with various Android devices.
Google make sit very clear in its documentation that the AAudio API is minimal in nature and does not offer the following functions:
- Automated routing between devices
- File I/O
- Decoding of compressed audio
And here’s how the company explains AAudio API works:
AAudio moves audio data between your app and the audio inputs and outputs on the device that’s running your app. Your app passes data in and out by reading from and writing to audio streams, represented by the structure AAudioStream. The read/write calls can be blocking or non-blocking.
If you are an Android developer, you can read more about AAudio API over here.
翻译
Android长期以来一直在努力为音频提供高延迟。因此,专业的音频应用程序在平台上是绝对不可能的。谷歌一直在努力解决这个问题,因为棒棒糖,并在这方面取得了长足的进步。
然而,音频延迟在设备之间的差异很大,继续使开发人员难以为该平台创建专业的音频应用。为了解决这个问题,Google正在Android OIO中引入AAudio API。
这个新的API为具体要求的应用程序提供了高性能的低延迟音频。将使用此API的应用程序将通过流来编写和接收数据,以获得最佳性能。开发人员将能够利用此API来为Android创建专业级的音频应用程序。该API的引入还将确保与各种Android设备的更宽兼容性。
Google在其文档中非常清楚,AAudio API性质极小,不提供以下功能:
- 设备之间的自动路由
- 文件I / O
- 压缩音频解码
以下是该公司如何解释AAudio API的作品:
AAudio在您的应用程序和运行应用程序的设备上的音频输入和输出之间移动音频数据。您的应用程序通过读取和写入音频流来传输数据,由结构AAudioStream表示。读/写调用可以是阻塞或非阻塞。
如果您是Android开发人员,您可以在这里阅读有关AAudio API的更多信息。
aaudio 1