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.
Page Index Toggle Pages: 1
Stop an audio track (Read 2489 times)
Stop an audio track
Jun 13th, 2010, 7:23am
 
Hello,

I tell you my situation.
I've got an image divised in areas. When the cursor pass in an area, start a song. There is a song for each area. In this process it's all right. My problem borns here: when the cursor leave the area, the song continue to play: I need that it stop, otherwise shortly all the songs play together and start the total caos!

So, here the question: what's the code to block my song when I exit by the area?

Thank you very much!  Smiley


P.S. I'm an italian guy, so I'm sorry for my language errors.
Re: Stop an audio track
Reply #1 - Jun 16th, 2010, 10:57pm
 
if(mouseIsInArea){
      //startPlaying the song
      // only make it play once or else it will keep
      // playing over it self

}
else{
 //stop the song
 //and rewind if its a imported sound file
}
Page Index Toggle Pages: 1