We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › running multiple sound files
Page Index Toggle Pages: 1
running multiple sound files (Read 995 times)
running multiple sound files
Apr 9th, 2010, 4:34pm
 
Hi guys,
I want to make a processing game that run a music file in the background and if the user pressed on left button play specific sound file, and if he pressed right button play another one
I used minim, but could not get what i want, below is my code:



import ddf.minim.*;
AudioPlayer player;
Minim minim;

      if (mouseButton == LEFT)
             {
                   player = minim.loadFile("chainsaw.wav",1);
                  player.play();
                 
             }
         else if (mouseButton == RIGHT)
             {
                   player = minim.loadFile("beep.wav", 2048);
                   player.close();// to close first one and then play the other
                    player.play();
             
              }


Could any one see what happend? and what about:
minim.stop();
super.stop();

Thanks





Page Index Toggle Pages: 1