Trying to run the test for OpenAL and getting the following:
C:\LWJGL\lwjgl-win32-0.96> java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\
lwjgl_util.jar;jar\lwjgl_fmod3.jar;jar\lwjgl_devil.jar; -Djava.library.path=nati
ve org.lwjgl.test.openal.PositionTest
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.DataInputStream.readInt(Unknown Source)
at com.sun.media.sound.WaveFileReader.getFMT(Unknown Source)
at com.sun.media.sound.WaveFileReader.getAudioInputStream(Unknown Source
)
at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
at org.lwjgl.util.WaveData.create(WaveData.java:93)
at org.lwjgl.test.openal.PositionTest.setup(PositionTest.java:199)
at org.lwjgl.test.openal.PositionTest.execute(PositionTest.java:127)
at org.lwjgl.test.openal.PositionTest.main(PositionTest.java:486)
Error setting up demonstration:
java.lang.NullPointerException
at org.lwjgl.test.openal.PositionTest.setup(PositionTest.java:200)
at org.lwjgl.test.openal.PositionTest.execute(PositionTest.java:127)
at org.lwjgl.test.openal.PositionTest.main(PositionTest.java:486)
C:\LWJGL\lwjgl-win32-0.96>
Why is this?
Also when i try and run the OpenGL Test's i get the following error (just stating it incase it is useful):
C:\LWJGL\lwjgl-win32-0.96> java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\
lwjgl_util.jar;jar\lwjgl_fmod3.jar;jar\lwjgl_devil.jar; -Djava.library.path=nati
ve org.lwjgl.test.opengl.shaders.ShadersTest none
Setting display mode to: 1024 x 768 x 32 @85Hz
Exception in thread "main" java.lang.NullPointerException
at org.lwjgl.test.opengl.shaders.ShadersTest.initialize(ShadersTest.java
:177)
at org.lwjgl.test.opengl.shaders.ShadersTest.main(ShadersTest.java:78)
Any help would be soo greatly appreciated. I've been trying to get 3D sound in my 2d game all week now, i started of with JOAL but that wasnt working (jvm crash for some reason) and then i turned to LWJGL for the OpenAL and now it is not working either.
Cheers, Nick!
oal is failing because it's not finding the samples (?) - should be located in the res folder, which you're including in the classpath - so everything should be fine...
Not sure about shades though
Yeah its strange, im using Java1.5.0 with the latest versino of LWJGL .96 i think it is. Ill try a couple more things and get back to you. Btw the first OpenAL test works -
C:\LWJGL\lwjgl-win32-0.96> java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\
lwjgl_util.jar;jar\lwjgl_fmod3.jar;jar\lwjgl_devil.jar; -Djava.library.path=nati
ve org.lwjgl.test.openal.ALCTest
DEFAULT_DEVICE_SPECIFIER: DirectSound3D
DEVICE_SPECIFIER: DirectSound3D
EXTENSIONS: Enumeration
ALC_MAJOR_VERSION: 1
ALC_MINOR_VERSION: 0
Value of ALC_MAJOR_VERSION: 4096
Does that mean its not going to be a complex problem to fix?
Also after running Lesson2 (provided in the tutorial i get same error) even though i have provided the Footsteps.wav in the current directory and the res directory??
Just a note on what ive done to set this up.
I've downloaded the LWJGL .96, extracted it to C:\LWJGL. Thats all? Do i need something else?? When i was using JOAL i downloaded the OpenAL sdk, do i need that??
openal works fine here- using the exact same setup...
QuoteC:\LWJGL\lwjgl-win32-0.96>dir
Volume in drive C has no label.
Volume Serial Number is FC52-0BDD
Directory of C:\LWJGL\lwjgl-win32-0.96
06-04-2005 13:06 <DIR> .
06-04-2005 13:06 <DIR> ..
06-04-2005 12:54 <DIR> doc
06-04-2005 12:54 <DIR> jar
06-04-2005 12:54 <DIR> native
30-03-2005 19:44 2.439 README
06-04-2005 12:54 <DIR> res
1 File(s) 2.439 bytes
6 Dir(s) 9.474.084.864 bytes free
C:\LWJGL\lwjgl-win32-0.96>
as for shaders, it's because it cant locate its shaders - the code is loading its resources in a wrong way - will fix for next release
Ok ill do it again:
So what do i do?
I download version .96 to C:\LWJGL
Then i extract that to C:\LWJGL
Then inside C:\LWJGL\lwjgl-win32-0.96\ i have all the folders and the readme etc.
Now to test the OpenAL i cd in command prompt to C:\LWJGL\lwjgl-win32-0.96, then ;
java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar;jar\lwjgl_fmod3.jar;jar\lwjgl_devil.jar; -Djava.library.path=native org.lwjgl.test.openal.PositionTest
Is that what i should be doing?
Could this in anyway be sounds card related? Or a driver problem?
Actually 1 thing, im using the java1.5.0 sdk but my jre is 1.5.0_02 (latest), so therefor im pretty sure im running the test on the jre version.
Fixed it :) I forgot i had also put the dll in the jre bin :P never mind, thanks guys!
HMM - you shouldn't have to do that *ponder*
WaveData.create(String filepath)
It is not a file-path, but a resource-path!
I tried absolute-paths and they all failed to load...
I tried relative-paths, and they also failed... (relative from "user.dir")
then I checked the source-code..
WaveData.class.getClassLoader().getResourceAsStream(filepath)
Which explained it... I'm now using WaveData.create(byte[] buf) as that just does what it says.
Please rename the parameter.