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.