0
0

Trying to find something about this in the manuals and in the forum, but haven’t found anything yet.

I have an event that has max playbacks set to 4. It is set to onehot == Yes. For each new event i call:

[code:qoboaix3]

FMOD_EventSystem_GetEvent(eventsystem, "path/to/event", FMOD_EVENT_DEFAULT, &event);
FMOD_EventSystem_Start(event);
[/code:qoboaix3]

This works just fine, I can play how many events of this type I want. Then I add an Event callback to the event in order to update my program when the oneshot events has finished playing. The callback functions work, but when i play the fifth event of this type (maxPlaybacks +1), the program crashes and I get an FMOD_ERR_FILE_UNWANTED error message.

Just before it crashes, an EVENT_STOLEN callback is received.
What can I do to fix this problem?

  • You must to post comments
0
0

hi gummipekk,

Did you get this behaviour before you added your callback? If not what are doing inside the callback? Does the callback return FMOD_OK?

The FMOD_ERR_FILE_UNWANTED error should only occur for getevent calls where the user has specified FMOD_EVENT_ERROR_ON_DISKACCESS as a mode flag, since you’re using FMOD_EVENT_DEFAULT you shouldn’t be seeing this error.

-Pete

  • You must to post comments
0
0

How can i check if the callback returns FMOD_OK? Where is this data received?

I did not have this problem before I set up the callback. The only thing I do inside the callback is printing the callback type.

I’m on OSX 10.5 btw.

  • You must to post comments
0
0

Your callback should look something like this:

[code:19eiqjpo]FMOD_RESULT F_CALLBACK FMOD_EVENT_CALLBACK(
FMOD_EVENT * event,
FMOD_EVENT_CALLBACKTYPE type,
void * param1,
void * param2,
void * userdata)
{

// More code goes here.

return FMOD_OK;

}[/code:19eiqjpo]

Your callback signature must exactly match what is required (no casting!) and you callback must return an FMOD_RESULT, usually FMOD_OK.

-Pete

  • You must to post comments
0
0

My callback function is just like like the example you have. Only I’ve added a switch to find which callback type is received.

  • You must to post comments
0
0

If you are returning FMOD_OK from the callback then there shouldn’t be any problem. Can you post the code for your callback so I can try to repro the behaviour you’re seeing?

-Pete

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.