Stopping U3D in the callback will get stuck


I don’t know how to solve this problem. I’ve had very short access to this plug-in. Now I want to play several music sequentially, and now I save it in a list. (Forgive me for not knowing how to use this plug-in regularly, if you have a better way, I hope you can tell me), and then use callback monitoring, like this [dialogue Callback, EVENT_CALLBACK_TYPE.DESTROYED]] It works well, but when I close it Unity3D gets stuck before the callback event is executed. My English is poor. I’m sorry.

FMOD.Studio.EVENT_CALLBACK dialogueCallback = new FMOD.Studio.EVENT_CALLBACK(DialogueEventCallback);

static FMOD.RESULT DialogueEventCallback(FMOD.Studio.EVENT_CALLBACK_TYPE type, FMOD.Studio.EventInstance instance, IntPtr parameterPtr)
return RESULT.OK;

public void PlayMusic(string audioName)
_bgmList = new List() { audioName };
_eventInstance = RuntimeManager.CreateInstance(_bgmList[0]);

_eventInstance.setCallback(dialogueCallback, EVENT_CALLBACK_TYPE.DESTROYED);



Now when I execute PlayMusic, the sound will be played back and forth, and when I stop running, Unity3D will be stuck.


Have a look at our Timeline Callbacks example, make sure you are freeing any pinned memory. Most platforms will also require [AOT.MonoPInvokeCallback(typeof(FMOD.Studio.EVENT_CALLBACK))] attribute on he callback function.


thank you for your help