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 & HelpSyntax Questions › I need help with stopping audio from playing.
Page Index Toggle Pages: 1
I need help with stopping audio from playing. (Read 660 times)
I need help with stopping audio from playing.
Nov 27th, 2009, 5:14pm
 
Right now I have it so that when you call this function it starts playing this song,

void mainMenu(){
 mainMenuAudio.play();
}


and it works but I don't know how to stop it. I want it so that when this other function gets called it stops playing that audio. What would I have to write in order to do that?

if(screens == 0){      
  mainMenu();
  //when this gets called it starts playing this song
}
else if(screens == LVLONE){
  gamePlayArea();
  //When this gets called it stops playing the song
}

Re: I need help with stopping audio from playing.
Reply #1 - Nov 27th, 2009, 5:27pm
 
did you write this yourself? did you copy the code from somewhere?
what is it, a library you are using?
Re: I need help with stopping audio from playing.
Reply #2 - Nov 28th, 2009, 2:09am
 
Are you using the Minim library?

Try one of these :
mainMenuAudio.stop();
or
mainMenuAudio.close();
Page Index Toggle Pages: 1