How to "fix" NullPointerExeption? (minim Couldn't load the file)

edited March 11 in Library Questions

Hi , I start Processing and I made a code to play a piano note, i run the code , but when i press the key to play the song , i have an error : NullPointer Exeption and === Minim Error === === Couldn't load the file G.mp3

This is my code : import ddf.minim.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; import ddf.minim.signals.*; import ddf.minim.spi.*; import ddf.minim.ugens.*;

import ddf.minim.*;

Minim minim; // création d'un objet de la classe Minim

AudioPlayer G;

void setup() {

minim = new Minim(this); // 'this' fait référence à l'application en cours

G = minim.loadFile("G.mp3");


void draw() {


if (key == 'u'); // key est la dernière touche activée du clavier

if (key == 'p') G.pause();


void stop() {





I'm french , I hope you to help me asap! :)



  • is the file name correct?

  • Is the file in the data directory or the sketch directory?

    You can drag the file onto the pde window or use the add file menu option to place it correctly.

    G is a terrible name for a variable. It should be lower case for a start, but choose something longer and more descriptive.

  • hum, ok I'll try

  • Now that's say :

    === Minim Error === === Couldn't load the file SOL.mp3

  • What line is showing the error? Please also format the code above. Edit your post, edit your code and hit ctrl+o.


  • Double check the file name and the location. That error says that your filename or location is incorrect.

Sign In or Register to comment.