Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Minim pause, stop, change volume

$
0
0
Few more problems with minim. 
1. I'm programming a game and I wanna mute music when player loses. I have 2 audio files playing so my function looks like this:
  1. void muteMusic() {
  2.   song1.close(); 
  3.   song2.close();
  4. }
But it gives me a NullPointerExeption. I tried using booleans, so that this function is triggered only once, but it didn't workю Like this:
  1. boolean endm=false;
  2. void lose() {
  3.   if(endm==false){
  4.   muteMusic();
  5.   endm=true;
  6.   }
  7. }
2. How to change volume of an Audio file. I tried setVolume() and setGain(), but it didn't work
3. How to pause an audio file and then resume it?

Viewing all articles
Browse latest Browse all 1768

Trending Articles