Hello Guest

Space Invader Sound Loading Problem

  • 7 Replies
  • 11616 Views
Space Invader Sound Loading Problem
« on: January 24, 2011, 16:04:45 »
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?

*

Offline kappa

  • *****
  • 1310
Re: Space Invader Sound Loading Problem
« Reply #1 on: January 24, 2011, 16:32:47 »
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).

Re: Space Invader Sound Loading Problem
« Reply #2 on: January 24, 2011, 22:35:15 »
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

Re: Space Invader Sound Loading Problem
« Reply #3 on: January 26, 2011, 15:36:57 »
Ah. Found the solution. ^^ thanks bro

Re: Space Invader Sound Loading Problem
« Reply #4 on: February 14, 2011, 04:37:19 »
im also having this problem and cant seem to fix it, do tell.

*

Offline Matzon

  • *****
  • 2242
Re: Space Invader Sound Loading Problem
« Reply #5 on: February 14, 2011, 06:35:09 »
as kappa says - you need to make sure the res folder is on the class path

Re: Space Invader Sound Loading Problem
« Reply #6 on: February 14, 2011, 14:22:21 »
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.

Re: Space Invader Sound Loading Problem
« Reply #7 on: June 25, 2013, 15:39:59 »
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?