two separate files, play at same time?

edited May 2014 in Library Questions

I have two seperate files that play audio on repeat at dealyed intervals. I need them to both begin at the same time and am not sure about how to do this?

First file:

import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;



import ddf.minim.*;

Minim minim;
AudioPlayer player;

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

   minim = new Minim(this);

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

delay(10000);

}

void draw()
{

  player.play();
  delay(10000);
  player.rewind();

  background(0);
  stroke(255);



}

The second file is similar but with different delays:

import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;



import ddf.minim.*;

Minim minim;
AudioPlayer player;

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

   minim = new Minim(this);

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

delay(4000);

}

void draw()
{

  player.play();
  delay(4000);
  player.rewind();

  background(0);
  stroke(255);



}

Is there a way of stitching these together or do i make another file that selects them both to play at the same time? I'm at a bit of a loss here!

Answers

Sign In or Register to comment.