The variable player you're trying to use, which is of object type AudioPlayer, has not been initialized yet!
You see, declaring an object variable is not enough.
All object variables start w/ value null,
which means it doesn't point to any allocated memory block reference yet!
The most common way to initialize such variables is using keyword new,
which allocates a new memory block for the instantiated object.
But there are some methods which also do that internally, like loadFile(), loadStrings(), loadImage(), etc.
All such methods creates a new instance of a class, making a copy object outta it!
However, from examples I've seen using library Minim,
the sketch's reference itself has to be passed as parameter!
You have to use keyword this to get the sketch's reference pointer!
Thus, the correct way to initialize a variable of type Minim is something like this:
minim_variable = new Minim(this);
So, remember to initialize object variables w/ a valid reference pointer of an instantiated object from a class!
You see, declaring an object variable is not enough.
All object variables start w/ value null,
which means it doesn't point to any allocated memory block reference yet!
The most common way to initialize such variables is using keyword new,
which allocates a new memory block for the instantiated object.
But there are some methods which also do that internally, like loadFile(), loadStrings(), loadImage(), etc.
All such methods creates a new instance of a class, making a copy object outta it!
However, from examples I've seen using library Minim,
the sketch's reference itself has to be passed as parameter!
You have to use keyword this to get the sketch's reference pointer!
Thus, the correct way to initialize a variable of type Minim is something like this:
minim_variable = new Minim(this);
So, remember to initialize object variables w/ a valid reference pointer of an instantiated object from a class!