Search Unity

Audio Unity Native Audio Plugin SDK in Android

Discussion in 'Audio & Video' started by bk, Apr 10, 2017.

  1. bk

    bk

    Joined:
    Dec 9, 2012
    Posts:
    1
    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.
     
  2. rorywalsh

    rorywalsh

    Joined:
    Apr 10, 2015
    Posts:
    114
    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.
     
  3. FritzM

    FritzM

    Joined:
    Jul 1, 2017
    Posts:
    4
    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
     
  4. mtytel

    mtytel

    Joined:
    Feb 28, 2014
    Posts:
    84
  5. mtytel

    mtytel

    Joined:
    Feb 28, 2014
    Posts:
    84
    FritzM likes this.
  6. FritzM

    FritzM

    Joined:
    Jul 1, 2017
    Posts:
    4
    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...
     
  7. FritzM

    FritzM

    Joined:
    Jul 1, 2017
    Posts:
    4
    Ah, I found out why. The name of the plugin bundle must start with "AudioPlugin", otherwise Unity doesn't load it.
     
  8. manassehclifford

    manassehclifford

    Joined:
    Sep 20, 2021
    Posts:
    8
    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.
     
  9. Deleted User

    Deleted User

    Guest

    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.
     
    Last edited by a moderator: Jul 14, 2023
  10. SeventhString

    SeventhString

    Unity Technologies

    Joined:
    Jan 12, 2023
    Posts:
    416
    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!