Hello Guest

OpenAL

  • 10 Replies
  • 16270 Views
OpenAL
« on: April 06, 2005, 09:02:56 »
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!

*

Offline Matzon

  • *****
  • 2242
OpenAL
« Reply #1 on: April 06, 2005, 09:10:46 »
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

OpenAL
« Reply #2 on: April 06, 2005, 09:15:42 »
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??

OpenAL
« Reply #3 on: April 06, 2005, 09:36:08 »
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??

*

Offline Matzon

  • *****
  • 2242
OpenAL
« Reply #4 on: April 06, 2005, 11:08:04 »
openal works fine here- using the exact same setup...
Quote
C:\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

OpenAL
« Reply #5 on: April 06, 2005, 11:13:48 »
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?

OpenAL
« Reply #6 on: April 06, 2005, 11:25:56 »
Could this in anyway be sounds card related? Or a driver problem?

OpenAL
« Reply #7 on: April 06, 2005, 11:41:45 »
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.

OpenAL
« Reply #8 on: April 06, 2005, 13:01:06 »
Fixed it :) I forgot i had also put the dll in the jre bin :P never mind, thanks guys!

*

Offline Matzon

  • *****
  • 2242
OpenAL
« Reply #9 on: April 06, 2005, 13:09:02 »
HMM - you shouldn't have to do that *ponder*

misleading parameter-name: WaveData.create(String filepath)
« Reply #10 on: April 30, 2005, 12:41:25 »
Code: [Select]
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..

Code: [Select]
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.