Problems with ALLEGRO_SAMPLE_ID*
I am having a slight problem with my audio class. It just stops responding when I use this->sample[id].sample_id in the al_play_sample() function.
Here is the struct used to hold the data.
This is the vector that holds the array.
This is how I load, play and stop the sounds.
std::string filename )
temp_sample = al_load_sample(
4 if (
this->sample.size() - 1;
12 return -1;
17 if (
id ) )
.sample, gain, pan, speed, loop, this->sample[
25 if (
id ) )
If I use this it works fine but then I have no sample id to stop it.
3 if (
id ) )
.sample, gain, pan, speed, loop, NULL );
Use ALLEGRO_SAMPLE_ID foo; and pass &foo as the parameter. You are passing around a pointer to unallocated memory.
Thank you so much. It works fine now
Edit: How do I thank you at the top?
"... is answered to my satisfaction"(there's a checkbox for it when you reply)
There is no boxes :/
Maybe this is because you didn't select "a question with a specific answer" or something like that...(when writing the OP)
When you create the thread, you have to select "A question or problem with a specific answer" under the Classification pulldown.
Thread #607054. Printed from Allegro.cc
Ahh, I shall keep that in mind thanks guys