Home>

I have inserted audio data into the data folder in the following program + pde file, but I cannot read the audio.
NullPointerException
I get an error.
Where should I change?

import ddf.minim. *;// Import the minim library

Minim minim;// Declaration of minim type Minim
AudioPlayer player;// Sound data storage variable

void setup () {

size (100, 100);
minim = new Minim (this);// initialization
player = minim.loadFile ("sample.mp3");// Load sample.mp3
player.play ();// Play
}

void draw () {

background (0);
}

void stop () {

player.close ();// Close sound data
minim.stop ();
super.stop ();
}

Trends