Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Testing a Sample for IsPlaying?

This thread is locked; no one can reply to it. rss feed Print
Testing a Sample for IsPlaying?
InfiniteLoop
Member #8,434
March 2007

Hello everyone, I am just messing around with audio and I was curious as to whether or not you can tell if audio is currently playing.

My code:

if(sx != x || sy != y)
        al_play_sample(sample, 1, 0, 1, ALLEGRO_PLAYMODE_ONCE, NULL);

I want to check if the sample is already playing before playing it again

Matthew Leverton
Supreme Loser
January 1999
avatar

You will need to create a sample instance from the sample data if you want to check that.

InfiniteLoop
Member #8,434
March 2007

Thank you. Once I have an instance, how do I check it to see if it is playing?

Matthew Leverton
Supreme Loser
January 1999
avatar

Go to: