For the lowest audio latency possible, we recommend you use Android native audio based on OpenSL ES 1.0.1.
To use Android native audio:
NDKroot
is the
directory where you installed NDK.
Note: the same buffer size and sample rate should also be used for input.
Use a PDF viewer to review the OpenSL 1.0.1 Specification. This is a rather long reference, and not all of it will be relevant to you; but you will need to consult it for details on the API.
Note: this document describes the full OpenSL ES 1.0.1, but Android native audio is actually based on a subset of OpenSL ES 1.0.1 with some Android-specific extensions.
Documents describing later versions of OpenSL ES, such as 1.1, are not relevant to Android.
The document "OpenSL ES for Android" is provided in the NDK installation, and is not currently available online. Open this link in a browser:
NDKroot/docs/Additional_library_docs/opensles/index.html
You'll want to skim the whole document, but pay special attention to the "Performance" subsection of the "Programming notes" section.
Section "Supported features from OpenSL ES 1.0.1" describes the subset supported by Android.
Section "Android extensions" describes Android-specific extensions that aren't included in base OpenSL ES 1.0.1.
This Venn diagram shows the relationship between Android native audio and OpenSL ES 1.0.1.
Figure 1. Venn diagram
The site source.android.com is primarily designed for OEMs building Android devices, and the SoC vendors who supply components to these OEMs.
However, there is a wealth of useful information about latency at this site, so you may want to review it. See the articles at Audio Latency.
If you have questions about how to use Android native audio, you can ask at the discussion group android-ndk.