Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Sample ID?

This thread is locked; no one can reply to it. rss feed Print
Sample ID?
kebapmanager
Member #14,863
January 2013
avatar

I want to stop my sample at certain point in my game , but I dont understand how to give my wanted sample and ID ?

jmasterx
Member #11,410
October 2009

void al_stop_sample(ALLEGRO_SAMPLE_ID *spl_id)
bool al_play_sample(ALLEGRO_SAMPLE *spl, float gain, float pan, float speed,
   ALLEGRO_PLAYMODE loop, ALLEGRO_SAMPLE_ID *ret_id)

So

ALLEGRO_SAMPLE_ID id;
ALLEGRO_SAMPLE* spl = al_load_sample("sound.ogg");
al_play_sample(spl, 1.0f, 1.0f, 1.0f,
   0, &id);
al_stop_sample(&id);
al_destroy_sample(spl);

kebapmanager
Member #14,863
January 2013
avatar

Thank you alot works perfectly!

Go to: