Go Down

Topic: NullPointerExeption - Processing trouble (Read 1 time) previous topic - next topic

alex_hinds

Hi, I'm new to using Processing and I'm having a bit of trouble trying to make some sound visual -
It says: NullPointerError

Exception in thread "Animation Thread" java.lang.NullPointerException
     at ddf.minim.javasound.JSMinim.getAudioInputStream(JSMinim.java:604)
     at ddf.minim.javasound.JSMinim.getAudioRecordingStream(JSMinim.java:200)
     at ddf.minim.Minim.loadFile(Minim.java:357)
     at ddf.minim.Minim.loadFile(Minim.java:341)
     at sketch_mar01a.setup(sketch_mar01a.java:45)
     at processing.core.PApplet.handleDraw(PApplet.java:1402)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Thread.java:619)

I'm trying to upload a file called groove.mp. This is what processing highlights:
 groove = minim.loadFile("groove.mp3");
I think it's having trouble finding it but i have put minim in the root folder etc, groove is definately there but when i hit play its blank.
Can anyone help?
Thanks,
Alex

PaulS

On my computer, there is a directory where the sketch is located. In that directory, there is a directory named data. In the data directory, there is a file named groove.mp3. The program runs and loads the file correctly (and even plays it).
The art of getting good answers lies in asking good questions.

GrooveFlotilla

Some people are like Slinkies.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.

alex_hinds

I have that too, and it runs when i load it but for some reason it cant find it when i try to run the script i'm working with. I'm just trying to replicate something i've found on the internet:
http://gracefulspoon.com/blog/2009/03/06/iggy-wave/comment-page-1/#comment-1411
Should be simple but its not working.

PaulS

Quote
I have that too, and it runs when i load it but for some reason it cant find it when i try to run the script i'm working with.


Let's see if we can properly parse that sentence. "I have that too". What might "that" be? The data directory containing groove.mp3?

..."and it runs"... What does?

..."but for some reason it cant".. What can't?

..."find it"... Find what?

..."when i try to run the script i'm working with." So post your script, not a link to a comment section with some vague reference to "this is what I'm trying to do."

Would you like to start over again?
The art of getting good answers lies in asking good questions.

easyDaMan

#5
Apr 07, 2010, 04:34 pm Last Edit: Apr 07, 2010, 04:41 pm by easyDaMan Reason: 1
I had that problem, too! Here is my solution!

System:
Win7-64, SunJDK

Windows sometimes does not show the suffixes of the file. My file was named song.mp3.mp3. After setting the folder options to show all file suffixes I could change the name of the file to song.mp3. And it actually plays right now. Together with Monsky Pong ;-)

Another hint I stumbled upon was: Processing does not understand copy pasted doublequotes. Just retype them in the IDE.

Well... these two methods solved my problem.

Peace

And BTW: the file is in the "data" folder where my sketch resides.

Go Up