ddf / Minim

A Java audio library, designed to be used with Processing.
http://code.compartmental.net/tools/minim
GNU Lesser General Public License v3.0
668 stars 136 forks source link

issue with loop(int num) #97

Open matinlotfali opened 5 years ago

matinlotfali commented 5 years ago

The mp3 file here loops 2 times with loop(3), indefinite times with loop(4), and 3 times with loop(5)

Minim version: 2.2.2 Installed with Processing 3.5.3

Here is my code:

int time = 10*60 + 1;
void setup()
{
  size(400, 400);
  minim = new Minim(this);
  player = minim.loadFile("alarm.mp3");
  frameRate(10);
}

void draw()
{
  if (frameCount%10 == 0 && time > 0)
  {
    time--;
    if (time % 60 == 0)  //check second
      if (time / 60 == 10 || time / 60 == 5 || time == 0) //check minute
        player.loop(5);
  }
}