Space Invader Sound Loading Problem

Started by SilentShaddo, January 24, 2011, 16:04:45

Previous topic - Next topic

SilentShaddo

Hey guys, I've followed everything on the http://lwjgl.com/wiki/index.php?title=Setting_Up_LWJGL_with_JCreator to set up space invader on jcreator but i am getting this problem:



Exception in thread "main" java.lang.NullPointerException
    at org.lwjgl.examples.spaceinvaders.SoundManager.addSound(SoundManager.java:157)
    at org.lwjgl.examples.spaceinvaders.Game.initialize(Game.java:250)
    at org.lwjgl.examples.spaceinvaders.Game.<init>(Game.java:182)
    at org.lwjgl.examples.spaceinvaders.Game.main(Game.java:588)


Does anyone know what I am doing wrong?

kappa

make sure the resources for the space invaders demo are also on the class path (i.e. the 'res' folder which contains the wav files).

SilentShaddo

I install it in my downloads folder. This makes it

C:\Users\Vong Vang\Downloads\lwjgl-2.6

and that res is also in that lwjgl-2.6 folder.

still giving me the same error

SilentShaddo

Ah. Found the solution. ^^ thanks bro

zakrn

im also having this problem and cant seem to fix it, do tell.

Matzon

as kappa says - you need to make sure the res folder is on the class path

Mickelukas

I got the same error when trying to add an ogg file. After having looked around a lot yesterday on the forum and other pages I came to the conclusion to use JOrbis for ogg sounds instead of JOAL.

lobsterman

same problem here and a bit of additional hand-holding would be great ... i assume i am adding the path to the eclipse project as follows

- go to project properties
- go to Resource
- select linked Resources
- in Path Variables click "New..."
- Name it "SPACEINVADERS_LOC" and select Location Folder res/spaceinvaders wherever the lwjgl folder is located

run ... but no go. same exception as before

Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.examples.spaceinvaders.SoundManager.addSound(SoundManager.java:157)
   at org.lwjgl.examples.spaceinvaders.Game.initialize(Game.java:250)
   at org.lwjgl.examples.spaceinvaders.Game.<init>(Game.java:182)
   at org.lwjgl.examples.spaceinvaders.Game.main(Game.java:588)
AL lib: (EE) alc_cleanup: 1 device not closed

any suggestions where i am going wrong?