How to wait for a sample to stop playing in Allegro 5
Edgar Reynaldo

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

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);

Edgar Reynaldo

Okay, I needed to create a voice and I needed to use INT16. al_get_sample_instance_playing is now working for me. And so is al_play_sample.

Thread #614284. Printed from Allegro.cc