Sound in LWJGL

Started by aurora, October 21, 2005, 13:08:16

Previous topic - Next topic

aurora

I've tried the lwjgl sound examples in the source and providing the wav and mp3 files to the program, however it still appears that it does not work. Is this a mistake I made or something else?

Matzon

When using OpenAL it can only play wav files (specifically PCM). Any other audio type and you have to decode to PCM or use the lwjgl-fmod binding

aurora

Thanks for the help, I think run another test. I've tried mp3 but I don't think I've tried wavs.

betwixt

I found a really gool class called SoundScape. You can set the position of the listener and the positions of multiple sounds. You should find it if you read this post http://lwjgl.org/forum/viewtopic.php?t=1385. To be more accurate the download site is at  http://potatoland.org/code/gl. And there is also code for loading .3ds files and displaying text! But I still don't know exactly how to play background music? I tried to set the positon of the background music to the location of the camera/viewport, but if I move the location of the viewport then my program counters an nullpointerexception because somehow the SoundScape.setListenerPosition(int soundHandle, float[] soundLocation); thinks that the coordinates that I set don't exist, but they do because I print them to the display in the same time.