How to use FMOD on mac? (SOLVED)

Hi!

I am trying to run the @dapetcu21 fmod example from https://github.com/dapetcu21/defold-fmod. I am sure everything is fine and I am doing something wrong.

If I build it then I get (twice) the following error in a window:

Cannot open “libfmod.dylib" since the developer cannot be verified

(or something similar, I read it in italian). Moreover in the console I get the following messages:

INFO:fmod: Running in the editor. Will attempt to load libraries from project
WARNING:fmod: dlopen(/Users/0000000/Desktop/defold-fmod-master/fmod/res/x86_64-osx/Contents/MacOS/libfmod.dylib, 10): no suitable image found. Did find:
/Users/0000000/Desktop/defold-fmod-master/fmod/res/x86_64-osx/Contents/MacOS/libfmod.dylib: code signature in (/Users/0000000/Desktop/defold-fmod-master/fmod/res/x86_64-osx/Contents/MacOS/libfmod.dylib) not valid for use in process using Library Validation: library load disallowed by system policy
WARNING:fmod: dlopen(/Users/0000000/Desktop/defold-fmod-master/fmod/res/x86_64-osx/Contents/MacOS/libfmodstudio.dylib, 10): no suitable image found. Did find:
/Users/0000000/Desktop/defold-fmod-master/fmod/res/x86_64-osx/Contents/MacOS/libfmodstudio.dylib: code signature in (/Users/0000000/Desktop/defold-fmod-master/fmod/res/x86_64-osx/Contents/MacOS/libfmodstudio.dylib) not valid for use in process using Library Validation: library load disallowed by system policy
/Users/0000000/Desktop/defold-fmod-master/fmod/res/x86_64-osx/Contents/MacOS/libfmodstudio.dylib: stat() failed with errno=1
WARNING:fmod: FMOD libraries could not be loaded. FMOD will be disabled for this session

On the other hand, if I bundle a Mac application then I get no error and the example seems to work. I hear the noise of an engine and I can pan it left/right with the mouse. Is this all I should hear in this example?

Any help? Thanks!

Hi! It might be that the fmod libs are not notarized or some other Gatekeeper issue. You might want to fiddle with your codesigning/SIP settings.

Try this: https://www.imore.com/how-open-apps-anywhere-macos-catalina-and-mojave

Also, if you downloaded the project with Safari/Chrome, it might still be quarantined by GateKeeper. Run sudo xattr -r -d com.apple.quarantine path/to/the/project/dir to clear the quarantine attribute.

If all fails, the overkill fix would be to disable SIP (https://www.macworld.co.uk/how-to/mac/how-turn-off-mac-os-x-system-integrity-protection-rootless-3638975/)

1 Like

@dapetcu21 Thanks! I tried the command you suggested about quarantine and now the project runs also in the editor! Great!

I am able to move the Defold logo and pan the sound effect. But I still get this in the console:

DEBUG:SCRIPT: The requested event, parameter, bus or vca could not be found.
DEBUG:SCRIPT: 74
DEBUG:SCRIPT: Ooops! This event doesn’t exist!

There should also be some other music / effects I am not hearing?

Thanks!

No no, that’s just some debug logging from the example project (it shows how to catch errors). If you can hear the engine, that means it runs fine :slight_smile:

1 Like

Perfect! Many, many thanks as usual! So, now I am ready to integrate your library in my project!

Which directories have I to copy in my project? I guess: fmod, example (but just to run the same test in my game). But what about “bridge” and “autocomplete”?

No need to copy the extension directories to your project. That’s not how library dependencies work. Go and read the README:

But TLDR: You need to add the library as a dependency to your game.project, then copy the fmod/res dir to your project somewhere and add the path to it to your game.project.

Also, make sure you register your project on the FMOD website and that you properly show their branding in your splash screen and credits.

3 Likes

Thanks! And my apologizes for the silly question about copying the directories… I am an absolute noob about this…

I have been able to run the engine sound from my project. For the moment I am using custom resources but will switch to bundle resources when time comes (sooner or later).

I will of course register the project on the FMOD website and show their images in splash screen and credits as requested.

Thanks again for your help and for your work with fmod.

2 Likes