0
0

So when a sound is done playing and its channel is auto-freed, and you try calling isPlaying on the channel you get a FMOD_ERR_INVALID_HANDLE or something to that sort (which I would expect).

Is there a better way to determine if a channel is done playing, like maybe a callback ?

  • You must to post comments
0
0

[quote="adanklefsen":3ji80b5c]So when a sound is done playing and its channel is auto-freed, and you try calling isPlaying on the channel you get a FMOD_ERR_INVALID_HANDLE or something to that sort (which I would expect).

Is there a better way to determine if a channel is done playing, like maybe a callback ?[/quote:3ji80b5c]

Yes a channel callback is the right way to determine when a sound finished:

From fmodex.chm
[code:3ji80b5c]FMOD_RESULT Channel::setCallback(
FMOD_CHANNEL_CALLBACKTYPE type,
FMOD_CHANNEL_CALLBACK callback,
int command
);[/code:3ji80b5c]

specify FMOD_CHANNEL_CALLBACKTYPE_END as type

[code:3ji80b5c]FMOD_RESULT F_CALLBACK mycallback(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, unsigned int commanddata1, unsigned int commanddata2)
{
FMOD::Channel *cppchannel = (FMOD::Channel *)channel;

// More code goes here.

return FMOD_OK;
}[/code:3ji80b5c]

Regards,
Franco

  • You must to post comments
0
0

Cool, Thanks!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.