Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

NullPointerException using minim

$
0
0

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 !


Viewing all articles
Browse latest Browse all 2896

Trending Articles