Hello,
I am trying to do something but I got an error. What I wanna do is to add a default sound to a custom class that will be played each time I click on it. So I created a new object :
Minim minim;
AudioPlayer globalsound;
void setup()
{
size(1366,768);
globalsound= minim.loadFile("sound.mp3");
}
void draw()
{
//do things
}
class Mynewobject
{
AudioPlayer defaultsound;
Mynewobject()
{
this.defaultsound=globalsound;
this.defaultsound.play();
}
}
Can you please help me to find out what I'm doing wrong ? Thanks in advance !