Little problem with music
in
Core Library Questions
•
1 year ago
Hello,
I've got this little problem, I want to play a song and when you press your mouse I want to let it stop of pause.
I guess it's a very stupid little mistake I make. But Processing said it couldn't find anything named 'musicPlays.'
Here's the code:
_____________________________________________
import ddf.minim.*;
boolean music = true;
Minim minim;
AudioPlayer player;
void musicPlays() {
if (music == true) {
minim = new Minim(this);
player = minim.loadFile("liedje.mp3");
player.loop();
}
}
void mousePressed(){
if (music == false) {
musicPlays.stop();
}
}
Thanks anyway!
I've got this little problem, I want to play a song and when you press your mouse I want to let it stop of pause.
I guess it's a very stupid little mistake I make. But Processing said it couldn't find anything named 'musicPlays.'
Here's the code:
_____________________________________________
import ddf.minim.*;
boolean music = true;
Minim minim;
AudioPlayer player;
void musicPlays() {
if (music == true) {
minim = new Minim(this);
player = minim.loadFile("liedje.mp3");
player.loop();
}
}
void mousePressed(){
if (music == false) {
musicPlays.stop();
}
}
Thanks anyway!
1