Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » How to wait for a sample to stop playing in Allegro 5

Credits go to Arthur Kalliokoski for helping out!
This thread is locked; no one can reply to it. rss feed Print
How to wait for a sample to stop playing in Allegro 5
Edgar Reynaldo
Major Reynaldo
May 2007
avatar

How do I tell if a sample has stopped playing yet? I don't see any al_wait_for_sample function or how to get a ALLEGRO_SAMPLE_INSTANCE* from using al_play_sample to use with al_is_sample_instance_playing(ALLEGRO_SAMPLE_INSTANCE*). What should I do?

Arthur Kalliokoski
Second in Command
February 2005
avatar

Example in paperclip, run from console with name of audio file as parameter for command line.

[EDIT]

Forgot the percent sign in line 101

      printf("sample position %d, sample length %d, sample is %4.2f%% complete\n",sample_position,sample_length,spos);

They all watch too much MSNBC... they get ideas.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: