1

I have gone through the documentation of the Android C++ high performance audio library: OBOE. There is no documentation on how to add the library to an Android project that uses an Android.mk build type.

I am looking for ideas on how to implement this.

donturner
  • 17,867
  • 8
  • 59
  • 81
Korogba
  • 105
  • 9

1 Answers1

1

It doesn't seem to be possible to use the prefab version with ndk-build, but it's not difficult to build OBOE from source. First, clone the oboe repository. Then translate the CMakeLists.txt file included with OBOE to Android.mk. The result would look something like this:

LOCAL_MODULE := OBOE
OBOE_PATH := <path to oboe>
LOCAL_SRC_FILES := $(OBOE_PATH)/src/aaudio/AAudioLoader.cpp <all oboe sources...>
LOCAL_C_INCLUDES := $(OBOE_PATH)/src $(OBOE_PATH)/include
LOCAL_EXPORT_C_INCLUDES := $(OBOE_PATH)/include
LOCAL_CFLAGS := -std=c++17 -Ofast
LOCAL_LDLIBS := -llog -lOpenSLES
include $(BUILD_SHARED_LIBRARY)

Then reference OBOE from your main module:

LOCAL_SHARED_LIBRARIES := OBOE
Max Klint
  • 716
  • 5
  • 8