Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Minim and Real Memory / Memory

$
0
0
As alternative I am testing right now, to not use an array but only one sample which is always closed again after using. This seems to take up significantly less memory and works fine.

  1. Minim minim;
  2. AudioPlayer voiceSampleSingleA;

  3. void setup(){
  4.       
  5. }

  6. void serialEvent(){
  7. ...
  8.       voiceSampleSingleA = minim.loadFile( folder + "/" + filenames[chosenItem], 512);
  9.       voiceSampleSingleA.rewind();
  10.        voiceSampleSingleA.play(); 
  11.       sampleClosing = false;
  12. }

  13. void draw(){

  14. if(sampleClosing == false && voiceSampleSingleA.isPlaying() == false){
  15.         voiceSampleSingleA.pause(); 
  16.         voiceSampleSingleA.close();
  17.         sampleClosing = true;

  18.       }
  19. }

Is this a bad idea?

Thanks!




Viewing all articles
Browse latest Browse all 1768

Trending Articles