0
0

Hi

I’ve set the FMOD_CHANNEL_CALLBACKTYPE_END callback on a channel.

The function only gets called once or twice initially, even when lots of sounds are starting & stopping. I imagine the callback should be called every time a sound ends.

I’m setting the callback like this:
myChannel->setCallback( FMOD_CHANNEL_CALLBACKTYPE_END, FmodEndSoundCallback, 0 );

And the callback signature looks like this:
FMOD_RESULT F_CALLBACK FmodEndSoundCallback(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, int command, unsigned int commanddata1, unsigned int commanddata2);

We’re using version 4.03.04.

Thanks
Justin

  • You must to post comments
0
0

FYI, I just tried this on the latest version, 4.04.04 and it is the same.

Thanks
Justin

  • You must to post comments
0
0

I think you have to reset the callback each time you assign a new sound to your channel (the channel gets reseted). I may be wrong, but that’s what I do in my code and it works well.

BTW, make sure you call System::update :)

  • You must to post comments
0
0

Thanks FireStorm

But we’re doing both of these things already. Interesting to know that it’s working for you. How are you creating your sounds? We’re using SOFTWARE and CREATECOMPRESSEDSAMPLE – I wonder if the latter could be causing issues.

Justin

  • You must to post comments
0
0

I’m using CREATECOMPRESEDSAMPLE too along with 2D and OPENMEMORY and everything works just fine…
I’ve just tried to add CREATECOMPRESSEDSAMPLE to all sounds in my game (it was just used for long ones before), and it worked too.
Basically I create the sound, start it paused, set the flags, volume and callback then unpause it.

  • You must to post comments
0
0

That’s odd, we’re doing exactly the same here (although many sounds are also 3D)..

Thankfully I managed to workaround the problem and avoid needing the callbacks.

Still interested to find out what was wrong though.

Justin

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.