LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: sprite on July 21, 2003, 21:31:42

Title: OpenAL Sound
Post by: sprite on July 21, 2003, 21:31:42
Hiya Again :)

I was wondering about the status of openAL... do any of the openAL test classes (from org.lwjgl.test.openal) work ?  I have only gotten exceptions (I've supplied sound files that exist for String[] args, of course).  I guess they are marked as a "work in progress", but I'd like to make sure.

If they don't work yet, what would be a simple code snippet that just loads and plays a simple sound file ?

Thanks,
sprite
Title: Re: OpenAL Sound
Post by: durandal on July 21, 2003, 21:46:54
Quote from: "sprite"Hiya Again :)

I was wondering about the status of openAL... do any of the openAL test classes (from org.lwjgl.test.openal) work ?  I have only gotten exceptions (I've supplied sound files that exist for String[] args, of course).  I guess they are marked as a "work in progress", but I'd like to make sure.

If they don't work yet, what would be a simple code snippet that just loads and plays a simple sound file ?

Hi Sprite!

Exactly what kind of exceptions are you getting? I use LWJGL 0.6 and all tests works for me (at least the basic ones). I also use OpenAL for a SoundAPI written for josrts.org and haven't experienced any problems so far.

/Kalle
Title: OpenAL Sound
Post by: sprite on July 22, 2003, 02:19:06
Hey : )

I'm using LWJGL 0.7 rite now; in specific I'm trying to run org.lwjgl.test.openal.PlayTest.  I provide "/data/chimes.wav" (hehe, the windows chime) as the argument and I get the following exception:

java.io.IOException: Stream closed
at java.io.BufferedInputStream.ensureOpen(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.DataInputStream.readInt(Unknown Source)
at com.sun.media.sound.WaveFileReader.getAudioFileFormat(Unknown Source)
at com.sun.media.sound.WaveFileReader.getAudioInputStream(Unknown Source)
at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
at org.lwjgl.test.openal.WaveData.create(Unknown Source)
at org.lwjgl.test.openal.PlayTest.execute(Unknown Source)
at org.lwjgl.test.openal.PlayTest.main(Unknown Source)
java.lang.NullPointerException
at org.lwjgl.test.openal.PlayTest.execute(Unknown Source)
at org.lwjgl.test.openal.PlayTest.main(Unknown Source)
Exception in thread "main"


I've tinkered with other things but I have no idea what's wrong.  I got stuff like this with 0.6 as well.  I have no idea why I'm getting a NullPointerException.  Am I using the wrong format, or what ?

*confused*
Title: OpenAL Sound
Post by: princec on July 22, 2003, 07:56:37
No, that's just a plain and simple file-not-found error, Java style...

Cas :)
Title: OpenAL Sound
Post by: AndersD on July 22, 2003, 13:50:20
"/data/chimes.wav" <= implies that the file is in a directory under [windows] [cde...]:\data\chimes.wav or [linux] /data/chimes.wav

new File(".","data/chimes.wav") is probably what you want (if my telepatic abilities are strong enough ;)

EDIT: nah, you probably didn't want any chimes.waw file  :wink:
Title: OpenAL Sound
Post by: sprite on July 22, 2003, 16:30:14
Well I feel dumb now  :wink:

Thanks a lot guys : )

sprite