Build Android with Fmod

Hi everyone!
I use AudioEngine (v3.17) and find that the sound will tremble (sound on Win32 and Android device different).
So I research Fmod : GitHub - semgilo/cocos2d-x-fmod: Cocos2d-x integrated fmod audio engine
So, I follow step:
Place fmod folder in external, don’t edit file: fmod/Android.mk
But when build *.apk, I meet error:
fmod.hpp:46: error: undefined reference to ‘FMOD_System_Create’
Maybe: cocos - jni - Android.mk not find fmod libs ( like ‘libfmodL.so’ )
What I wrong?, please help me?

Yeah we got this for ya.
ok put the Fmod.jar in folder C:\ YouProject\proj.android\app\lib
goes in the lib.
then in your YouApp\proj.android\app\src\org\cocos2dx\cpp\AppActivity.java
add this to the you will see thease lines. Thats where we pick up the Fmod from the AppActivity.java

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
// Enable rendering into the cutout area
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
getWindow().setAttributes(lp);
Cocos2dxActivity.getContext().getExternalFilesDirs(“DacPlayer”);
}

    // DO OTHER INITIALIZATION BELOW

//its this one
org.fmod.FMOD.init(this);
}

//and this one
static {
System.loadLibrary(“fmod”);
}

//thuis staic came from when I done an import from android studio
Enjoy, PS if you chuck tinyXML in thern then you have acsess to SQL as well its done the same the way.

1 Like