Testing a Sample for IsPlaying?
InfiniteLoop

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

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

InfiniteLoop

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

Matthew Leverton
Thread #608701. Printed from Allegro.cc