i am using this code
void ERRCHECK ( FMOD_RESULT result ) ; FMOD::System * system; FMOD::Sound * sound; FMOD::Channel * channel; FMOD_RESULT result; FMOD_RESULT F_CALLBACK endCallBackFunc( void );
result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
if ( result != FMOD_OK )
channel->setCallback(FMOD_CHANNEL_CALLBACKTYPE_END, 0, endCallBackFunc());
FMOD_RESULT F_CALLBACK player::endCallBackFunc( void )
this is code work, but a signal appears at the start of file but not at completion of playing. Why ?
- modex asked 10 years ago
[quote="bluemonkmn":12hdwx9c]It looks like you have the parameters to setcallback in the wrong order. Swap the last two parameters.[/quote:12hdwx9c]
Hm no i think thats not the fact…
@modex: Have a look at this part of your code:
[quote:12hdwx9c][code:12hdwx9c]channel->setCallback(FMOD_CHANNEL_CALLBACKTYPE_END, 0, endCallBackFunc()); [/code:12hdwx9c][/quote:12hdwx9c]
You should leave out the brackets i:12hdwx9c[/i:12hdwx9c] , because you must pass the [u:12hdwx9c]address[/u:12hdwx9c] of the function. Here you’ve made a call to ‘endCallBackFunc’.
(And because of returning FMOD_OK in ‘endCallBackFunc’, which is actually defined as zero, it doesn’t crash during runtime 😉 . )
I think there’s also a problem with the signature of the callback function itself. It’s defined with no parameters in the given example, but it needs to conform to FMOD_CHANNEL_CALLBACK, which looks like:
[code:vj2jq7oy]FMOD_RESULT F_CALLBACK FMOD_CHANNEL_CALLBACK(
FMOD_CHANNEL * channel,
unsigned int commanddata1,
unsigned int commanddata2
Please login first to submit.