Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
dangus
dangus's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Trying to make a thread sleep (minim)
[2 Replies]
08-Dec-2012 11:46 AM
Forum:
Core Library Questions
Hello everyone!
Im quite new to Processing, and im currently experimenting with the minim lib.
The issue is that i want to load the audi files into an array and play them one after one. But the audio was playing all at once.
At the moment im trying to make the thread sleep but without any luck ("Unhandled exception type Interrupted Exception").
Any suggestion on what i could do?
import ddf.minim.*; //Minim library
import ddf.minim.analysis.*;
Minim minim;
AudioPlayer player[]; //Player array
//-----------------------------------------------------------------------------------
void setup() {
minim = new Minim(this);
player = new AudioPlayer[8]; //setup Array
int i = 1;
//Getting the Audio
while(i<8){
player[i] = minim.loadFile(i + ".mp3");
player[i].play();
//Trying to stop it
while(player[i].isPlaying()){
Thread.sleep(player[i].length());
}
i++;
}
}
//---------------------------------------------------------------------------------------
«Prev
Next »
Moderate user : dangus
Forum