The purpose of this fork is to add support for output latency calculation using OpenSL ES on Android 7.0+. Usage is the same as the core Oboe library, with the addition that you should provide implementations of JNI_OnLoad/JNI_OnUnload and pass the associated JavaVM instance to Oboe:
#include "oboe/Jni.h"
extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM * jvm, void * /*reserved*/) {
oboe::jniLoad(jvm);
return JNI_VERSION_1_6;
}
extern "C" JNIEXPORT jint JNICALL JNI_OnUnload(JavaVM * jvm, void * /*reserved*/) {
oboe::jniUnload();
}
Oboe will cache the JavaVM internally and automatically use it to query timestamps via JNI for OpenSL ES output streams, adding support for getTimestamp() and calculateLatencyMillis() in AudioOutputStreamOpenSLES.
NOTE: No logic is done internally to attach/detach threads to the JavaVM, so these methods should only be called on threads that are already attached.
Querying timestamps/latency is still not supported for input streams.
Oboe is a C++ library which makes it easy to build high-performance audio apps on Android. It was created primarily to allow developers to target a simplified API that works across multiple API levels back to API level 16 (Jelly Bean).
- Compatible with API 16 onwards - runs on 99% of Android devices
- Chooses the audio API (OpenSL ES on API 16+ or AAudio on API 27+) which will give the best audio performance on the target Android device
- Automatic latency tuning
- Modern C++ allowing you to write clean, elegant code
- Used by popular apps and frameworks
To build Oboe you will need the Android NDK r17 or above. It can be installed using Android Studio's SDK manager, or via direct download.
- Getting Started Guide
- Full Guide to Oboe
- API reference
- History of Audio features/bugs by Android version
- Frequently Asked Questions (FAQ)
Sample apps can be found in the samples directory. Also check out the Rhythm Game codelab.
- Ableton Link integration demo (author: jbloit)
We would love to receive your pull requests. Before we can though, please read the contributing guidelines.
View the releases page.