Using mills(); instead of delay();?

edited April 2014 in Questions about Code

I am trying to make this audio that I have in the code to loop every 5 seconds. With the delay I thought it would do this but instead it plays it perfectly the first time and then when five seconds comes around it seems to cut the audio to a millisecond of it. I was told to use mills but I am not sure as to how to implement this into my code?

import ddf.minim.*;

Minim minim;
AudioPlayer player;

void setup()
{
  size(512, 200, P3D);

   minim = new Minim(this);

  player = minim.loadFile("clap_01.mp3");



}

void draw()
{

  player.play();
  delay(5000);

  background(0);
  stroke(255);



}

any help would be very appreciated!

Also is it a possibility to get the audio to only play out from the left speaker? Ot is that down the audio editing itself?

Answers

Sign In or Register to comment.