for(int32 ni = 0; ni < Len;)
{ switch(nr){
case 0: play sound0;
propellerAudioComponent->OnAudioFinished.AddDynamic(this, &AMyclass::bools);
…
}
m_semaphore->Wait();
++ni;
}
void AMyclass::bools(){
m_semaphore->Trigger();
}
Problem is that the editor crashes when calling bools();
I want to wait until the first sound finishes then play the next sound.
Thankyou in advance.
Thankyou for your quick reply and yes, its a ufunction it works very good. If I write something else in there it works. The problem is that I dont think I can use semaphore in an actor class, only in threads.
You just need to have an array of sounds to play and an integer that controls the current sound you are playing, when you detect that the audio has finished you increment the integer and order the next sound to play so in pseudo code it would be something like this: