Unity Native Audio Plugin SDK in Android

Is there any example of Unity Native Audio Plugin SDK in Android, i’m trying to build a game and i need lots of hardcore DSP. Unity Native Audio Plugin SDK documentation is kind of bad it only talks about OSX and Windows. Please help, I would really appreciate if someone share something like a simple audio gain plugin template for Android. Thanks in advance.

I’d also like to see this made available. For what it’s worth I find the Native Audio Plugin documentation more than ‘kind of bad’. In comparison to the main Unity documentation it sucks.

Hi,
Did you ever solve this issue? I have many issues like this which are not addressed in the Unity Native Audio Plugin documentation, and have a real hard time figuring them out. Another one would be how to load an impulse response from the editor into a convolution reverb plugin. Any ideas?
Best regards,
Fritz

Start with just a normal native Android plugin:

This was also useful for me. This project has a working Android and iOS native audio build.

1 Like

Thanks for the links. This will certainly be useful to me at some point. At the moment I’m still struggling with even more basic problems, even just to get this working on Mac and PC. For example if I take the Native Audio Plugin example project and change the name of the project from “AudioPluginDemo” to something else in XCode, it stops working…

Ah, I found out why. The name of the plugin bundle must start with “AudioPlugin”, otherwise Unity doesn’t load it.

Hi ANY LUCK WITH ANDROID BUILDS? I tried using juce to export a apk and extracting the .so files from it to use but zero luck. i always get an error saying the plugin is not found in the project while debugging it.

Hi all, I spent a solid day banging my head against this so would like to share my solution.

The Android native audio plugin must start with ‘lib’ or it will not load. Then after that it must have ‘audioplugin’ (case-insensitive).

So once I renamed my plugin to be ‘libaudioplugin_my_plugin.so’ then my plugin was recognized on Android (Quest 2).

My folder structure:

Assets/
├─ Plugins/
│ ├─ Windows/
│ │ ├─ audioplugin_my_plugin.dll
│ ├─ Android/
│ │ ├─ ARM64/
│ │ │ ├─ libaudioplugin_my_plugin.so

If anyone at Unity reads this, please update your docs on the native audio plugin page to include a note about the very particular naming requirements for native audio plugins for Android.

Hi!

Yeah this kind of unspoken law is kind of frustrating… Shared libraries on Unix-based system generally require this ‘lib’ prefix to be recognized, I think it’s even mandatory when using dlopen(). I found this bit in the docs mentioning the ‘audioplugin’ part:

I started a PR in the docs to add a clarification on this. Thanks for bringing it up!