A few weeks ago, I decided to add support for OpenSL ES to Pd for Android. OpenSL ES is the native audio API of Android as of Android 2.3 (Gingerbread), and supporting it makes sense since it promises to reduce the overhead that the audio thread has to deal with.
The entire project felt a bit like squaring the circle because it required changing pretty much the entire JNI layer while leaving the public Java API untouched. After all, there are a fair number of existing projects that I didn’t want to break, and I also wanted to make sure that my recent book would remain relevant.
The good news is that I managed to meet those goals, while simultaneously opening up exciting new use cases for the Java bindings of libpd. In particular, the new version of libpd transparently supports all versions of Android. It uses OpenSL when available and defaults to the previous solution otherwise.
I’ll elaborate on the various components in a series of upcoming posts. I believe that some of them may be interesting in their own right. In the meantime, you can check out the upcoming revision of Pd for Android at GitHub. (Make sure to say
git checkout opensl as well as
git submodule update after cloning pd-for-android.) Any feedback will be appreciated!