Sign in to follow this  
m41q

LWJGL - Problem with the sound

Recommended Posts

m41q    151
Hi,

I now got far enough with my game to check out the tutorials for OpenAL realized with LWJGL, but I´m struggling with the differences of two tutorials.

On the main page of the LWJGL-wiki are tose tutorials to be found:
[url="http://lwjgl.org/wiki/index.php?title=Slick-Util_Library_-_Part_2_-_Loading_Sounds_for_LWJGL"]http://lwjgl.org/wik...ounds_for_LWJGL[/url]
[url="http://lwjgl.org/wiki/index.php?title=OpenAL_Tutorial_1_-_Single_Static_Source"]http://lwjgl.org/wik...e_Static_Source[/url]


The problem now lies with the Loading of the soundfiles:

I´d like to use the Slick-Util-Library, due to its facility to load .ogg sound (wich is my preffered format).
The other tutorial explains the technique to create 3D-Stereo-Soundeffects, but it only uses .wav-files.

Now I´m struggling to merge both lessons to be able to make this work:

The methods of the OpenAL-tutorial cannot be applied to data stored in the class org.newdawn.slick.openal.Audio, they require some sort of ByteBuffer (the tutorial uses a class called "WaveData"). So I am not able to load a .ogg-file and do 3D-Sound-effects and all that fancy stuff.


The question now is,
how do I convert "Audio" to "WaveData" or simply
how how can I make those methods work?

Thx, in advance

Share this post


Link to post
Share on other sites
m41q    151
if no one knows about this topic...

Any suggestion of an alternative viable method of using 3D-Sound (.ogg-files) with Java is appreciated as well.


EDIT:

SOLVED:

Just in case anyone has the same problem:

There is a class similar to WaveData, called OggData, but it has to be decoded first (using the class "OggDecoder").
A pretty solid explanation of the stuff can be found here:
[url="http://www.cokeandcode.com/index.html?page=tutorials/ast4"]http://www.cokeandcode.com/index.html?page=tutorials/ast4[/url]

It is a tutorial for the sounds of a game made with LWJGL, using .ogg-files and the sound-buffers for 3D-Sound (althougt I think they did not acutally implement the 3D-effect).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this