im not that good at english, so you want to play more than one sound one after another? i think you can check with playing() if a sound is playing at the moment but i'm not sure!
It's not normally a good idea to completely halt the execution of a sketch (especially in Processing's graphics-oriented world), but in this isolated case it can't really hurt anything...
Just loop until it finishes:
void say(String w) {
AudioPlayer p = audioClips.get(w);
if (p == null) {
println("Loading: " + w);
p = minim.loadFile(w);
audioClips.put(w, p);
}
p.rewind();
p.play();
//Loop...
while(p.isPlaying()) {
//Check back every 1/2 second
Thread.sleep(500);
}
//When we break out of the loop, the player has completed...
//...and we can move on
}
Answers
im not that good at english, so you want to play more than one sound one after another? i think you can check with playing() if a sound is playing at the moment but i'm not sure!
maybe i can help you a bit with my answer
I don't want to do a busy wait, I want to sleep until the sound is done playing. This code will play two sounds simultaneously.
It's not normally a good idea to completely halt the execution of a sketch (especially in Processing's graphics-oriented world), but in this isolated case it can't really hurt anything...
Just loop until it finishes: