0
0

I set a callback function to stop a event when sound end, and for ‘oneshot’ event it’s ok. But for ‘loop’ event and the ‘max playbacks = 1’, when the event been stolen, it crash.
FMOD_RESULT F_CALLBACK EventCallBack(FMOD_EVENT * event,
FMOD_EVENT_CALLBACKTYPE type,
void * param1,
void * param2,
void * userdata)
{
FMOD::Event* pEvent = reinterpret_cast<FMOD::Event*>(event);

switch(type)
{
case FMOD_EVENT_CALLBACKTYPE_SOUNDDEF_END:
    pEvent-&gt;stop(true);
    break;
            }

return FMOD_OK;

}

help me please, thanks.

  • You must to post comments
0
0

do not call stop from an event callback.

You don’t even need to do this in code. You can just set ‘oneshot = yes’ in the event property sheet and it will do it automatically with no programmer intervention.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.