I see you are on a PC, I'm on a Mac (10.8.4). Could that be the problem. Since I did the same sketch and it stops playing after No. 32, even though it list the other mp3s and says "true" to them playing? Now on processing 2.0.1 and with Memory set to 2048 / 64bit.
- import processing.serial.*;
- import ddf.minim.*;
- Minim minim;
- AudioPlayer voiceSampleSingle;
- AudioPlayer[] voiceSample;
- String[] filenames;
- int noOfSamples = 0;
- int count;
- void setup(){
- size(200,200);
- minim = new Minim(this);
- java.io.File folder = new java.io.File(dataPath("singles"));
- println(folder);
- filenames = folder.list();
- // get number of songs for array
- voiceSample = new AudioPlayer[filenames.length];
- noOfSamples = filenames.length - 1;
- // load each file into the array
- println(filenames.length);
- for (int i = 1; i < filenames.length; i++) {
- voiceSampleSingle = minim.loadFile( folder + "/" + filenames[i], 512);
- voiceSample[i-1] = voiceSampleSingle;
- println(filenames[i]);
- }
- voiceSample[33].rewind();
- voiceSample[33].play();
- }
- void draw(){
- background(0);
- }
- void keyPressed() {
- println("prrssed");
- if (key == 'a') {
- for (int i=0; i<voiceSample.length-1; i++) {
- println(voiceSample[i].isPlaying());
- if (voiceSample[i].isPlaying()) {
- voiceSample[i].pause();
- }
- }
- count = ++count%voiceSample.length;
- voiceSample[count].play();
- println("Number " + count + " (" + filenames[count] + ") is currently playing.");
- }
- }