I have a sample loaded and I want to check if it is already playing on a channel, so I can start only a limited number of sounds of this kind (like some random sounds).

I see there is a IsPlaying function for channels but not for samples (I think).

Is there a way to find the channels my sample is playing on?
Or do I have to manage each channel returned by the Play function and check them when ended (would that be bad for frame?).

I understand that the channel id returned by the Play function is ‘reference counted’ for unicity. I can get the real channel index from the first 12 bits (if i remember correctly), but is there a way to get the channel id from the chanel index ? Here is what I have in mind:

// test channel (i) if it’s playing or if it’s playing my sample …

I am new to fmod and I’m sorry if the answer to my question is obvious or I it’s somewhere in the fmod documentation.

Thank you!

  • You must to post comments

Thanks for the answer!
I was under the impression that FSOUND_GetCurrentSample needs to receive the channel handler received from the Play function (like other channel functions) and that was way bigger than the maxchannel since it contains the ref counter.
FSOUND_Sample_SetMaxPlaybacks could be an option too.
Thanks again!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.