OpenAL issues

I’m having a hard time getting my soundengine to work.
I’ve recently decided to use LWJGL instead of JOAL+JOGL+JInput in my project but now I can’t get even the most simple OpenAL implementation to work. I’ve had some experience dabbling with this library in C and with JOAL, but this is the first go with LWJGL. This is what happends when I try to run the “Lesson1” code found at lwjgl.org:


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 Lesson1.loadALData(Lesson1.java:105)
        at Lesson1.execute(Lesson1.java:162)
        at Lesson1.main(Lesson1.java:204)
Exception in thread "main" java.lang.NullPointerException
        at Lesson1.loadALData(Lesson1.java:106)
        at Lesson1.execute(Lesson1.java:162)
        at Lesson1.main(Lesson1.java:204)

Running my own code inside Eclipse gives this output.


java.lang.NullPointerException
	at org.lwjgl.util.WaveData.create(WaveData.java:93)
	at Main.main(Main.java:71)

I’ve tried to read in the file as a byte array and pass that to WaveData.create but that just gives me a bunch of other exceptions. What could be wrong?? Could it possibly be something inside my own code??? I find that unlikely since even the “official” examples fails.

Besides this problem, I think it’s great to work with LWJGL and I really like the idea of only leaning against one set of javabindings/API/lib/Whatever, wich makes it a hell of a lot easier to distribute the game when, and if, it ever gets done.

try looking in org.lwjgl.test.openal.* for some examples.
All of the exceptions you have posted, are “user errors”

Hmm… I took the lazy route when I installed LWJGL and just stuffed it into my JRE’s lib/ext/ folder. After a complete reinstall of JDK6 I added the lwjgl jars as “external jars” inside eclipse… Now it works… A fine example of what a few hours of sleep is worth :smiley:

So, now it not just good looking*, it sounds well too…

*beauty is in the eye of the beholder, isn’t it so?? My “coder graphics” are stunning