Skip to content
/ oboe Public
forked from google/oboe

Oboe is a C++ library which makes it easy to build high-performance audio apps on Android.

License

Notifications You must be signed in to change notification settings

acrimi/oboe

 
 

Repository files navigation

About This Fork

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 Build Status

Introduction to Oboe video

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).

Features

  • 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

Requirements

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.

Documentation

Sample code

Sample apps can be found in the samples directory. Also check out the Rhythm Game codelab.

Third party sample code

Contributing

We would love to receive your pull requests. Before we can though, please read the contributing guidelines.

Version history

View the releases page.

License

LICENSE

About

Oboe is a C++ library which makes it easy to build high-performance audio apps on Android.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 57.7%
  • Java 39.9%
  • Shell 1.2%
  • Other 1.2%