I was hoping someone could shed some light on what I may be doing wrong... I've struggled with this all night and have exhausted my searching options.
What I am trying to achieve is to open a file chooser when the user clicks the Open File button (which is a controlP5 button) and select an MP3 which then converts the path of the file chosen and stores that in a string which then can be played by pressing the Play button.
If I click Open File, it opens the file chooser but when I acknowledge the file, the sketch hangs.
Am I going about this the right way or is there a much simpler way?
if (returnVal == JFileChooser.APPROVE_OPTION) { file = fc.getSelectedFile(); song = file.getPath(); minim = new Minim(this); player = minim.loadFile(song, 512); } } } }
void stop() { // the AudioPlayer you got from Minim.loadFile() player.close(); minim.stop();
// this calls the stop method that // you are overriding by defining your own // it must be called so that your application // can do all the cleanup it would normally do super.stop(); }