When you re-load and play a new sound with minim, the old sound will still play ...?

I have this; a new sound is loaded, the old one will still play
can this be fixed, or is it just the way minim works … ?

I want to be able to load a new sound to save memory

Code:

  for ( int i = 0; i < 2; i++ ) {
    if (  this.countMP3Renewed > 0) { 
      player[i].mute();
      player[i].close();
    }

    // problem!, when new sound has been loaded, the old one will still play!
    player[i] = minim.loadFile( soundNames[i]  );
    player[i].setGain( -40 );
    player[i].loop();
  }
2 Likes

just say stop() before loading?

4 Likes

I did a minim.stop();
And this fixed the issue!, thx!

1 Like