Hi, I’m am using the newly released Unity FMOD integration (1.08.00), and I am trying to replicate the callback for getting Markers and beats from an event instance, as shown in the documentation below.
This works fine in the editor and on android, however on iOS, I am getting Just In Time errors when I try to set the callback. Unfortunately the problem seems to be in your dll. Do you know of any work around?
ExecutionEngineException: Attempting to JIT compile method ‘(wrapper
native-to-managed) MainTrackController:BeatEventCallback
(FMOD.Studio.EVENT_CALLBACK_TYPE,intptr,intptr)’ while running with
–aot-only.
at (wrapper managed-to-native)
FMOD.Studio.EventInstance:FMOD_Studio_EventInstance_SetCallback
(intptr,FMOD.Studio.EVENT_CALLBACK,FMOD.Studio.EVENT_CALLBACK_TYPE)
at FMOD.Studio.EventInstance.setCallback (FMOD.Studio.EVENT_CALLBACK
callback, EVENT_CALLBACK_TYPE callbackmask) [0x00000] in :0 at MainTrackController.Play () [0x00000] in :0 at GarageGameController.Begin () [0x00000] in :0
I rebuilt it using IL2CPP, but I now I am getting a MonoPInvokeCallback error.
I’ve looked at Unity specific examples of implemented MonoPInvokeCallback, but I’m unsure how to apply it to your plugin.
NotSupportedException: To marshal a manged method, please add an attribute named ‘MonoPInvokeCallback’ to the method definition.
at FMOD.Studio.EventInstance.FMOD_Studio_EventInstance_SetCallback (IntPtr _event, FMOD.Studio.EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask) [0x00000] in :0
at FMOD.Studio.EventInstance.setCallback (FMOD.Studio.EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask) [0x00000] in :0
at MainTrackController.Play () [0x00000] in :0
at GarageGameController.Begin () [0x00000] in :0
(Filename: currently not available on il2cpp Line: -1)