Hi guys

ok, I’m new to FMOD, so if this is an old topic, soz…

(if I say sample and not stream, assume stream is mentioned too, just stops me typing as much)

I want to wrap up FMOND within an object in my engine, I’ve done so and now I have a nice simple API which isnt related to FMOD, but can use it and I like it….

what I want to do, is to create a sample, then play it and know whether the SAMPLE is playing, note, not the channel, the sample…..

thing is, from what I gather you can only detect whether a channel is playing, now since you get the channel id returned to you when you try to play the sample.

Now what if I have two samples, A and B and my program execution goes like this

Play sample A + get channel id

Do something

Sample A Ends

Play sample B + get channel id (it aquires the same channel as A did before it ended)

Detect whether sample A is playing, by asking whether channel id it stored is active or not

yes it’s active, so sample A is playing

NO, sample A finished, but sample B is playing on the same channel, so I get a misdetect, it’s detecting the wrong sample playing

urgh, I’ve attempted to find a way around this, but since there are skilled people on here who know more about the api than me, I thought I would ask, thanks !

  • You must to post comments

When Sample A stops playing, you should set the channel variable to 0.
I think there is a callback that tells you when a sample stops, but I’m not sure…

  • You must to post comments

Aha, thanks

now I suppose I have to find out how to know when a samples stops playing, of course, if someone here knows and has a couple of seconds spare to point it out, I wouldnt say no :smile:


  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.