Hi,
thanks for the input.
It seems to work like this, yet it increases the Real Memory constantly.
What I'm doing is:
- void setup(){
- ...
- voiceSampleSingleA = new FilePlayer[noOfSamples];
- mainOut = minim.getLineOut();
- for (int i = 0; i < filenames.length; i++) {
- voiceSampleSingleA[i] = new FilePlayer(minim.loadFileStream( folder + "/" + filenames[i], 1024, true ));
- }
- voiceSampleSingleA[1].patch( mainOut );
- void serialEvent (Serial myPort) {
- int chosenItem = NoOfSampleToBePlay;
- voiceSampleSingleA[chosenItem].rewind();
- voiceSampleSingleA[chosenItem].play();
- voiceSampleSingleA[chosenItem].patch( mainOut );
- }
Then I should be closing it or not?
Thanks!