Minim: soundfile doesn't stop looping when specifying number of loops
in
Core Library Questions
•
1 year ago
I have a class that generates notes, and a method to play them back with a drum loop.
When I try to set the number of loops inside the method, the drum loop doesn't stop looping. I don't know what I'm doing wrong. Here's the code of class' play method. No matter what number I put into .loop(), it's the same. Any ideas? Thanks in advance!
When I try to set the number of loops inside the method, the drum loop doesn't stop looping. I don't know what I'm doing wrong. Here's the code of class' play method. No matter what number I put into .loop(), it's the same. Any ideas? Thanks in advance!
- void play () {
player = minim.loadFile("tribe1.mp3", 2048);
player.loop(1);
println ("loops: " + player.loopCount());
out.pauseNotes();
int aLen1 = max( bass.size(), lead.size());
for (int i = 0; i<aLen1; i++) {
if (i < bass.size()) {
NotaC bas = (NotaC) bass.get(i);
bas.play(0);
}
if (i < lead.size()) {
NotaC leads = (NotaC) lead.get(i);
leads.play(0);
}
}
out.resumeNotes();
}
1