May 10th, 2013, 09:13 AM
OpenAL error with Java Executable Jar File
I am programming a game in Eclipse using OpenAL for sound, and when I play it within the IDE it runs smoothly.
As soon as I export it as an executable jar file and try to run it from the system, the game locks as soon as a sound is about to be played.
This is how I load the file in my Sound Class which uses OpenAL:
In my game class I have an instance of the sound class called snd, and when I play a sound I run the command:
WaveData waveFile = WaveData.create(Collisions.class.getResource(sentSound));
AL10.alBufferData(buffer.get(0), waveFile.format, waveFile.data, waveFile.samplerate);
The rest of the code that follows and precedes these statements is pretty much the exact code from the OpenAL tutorial on lwjgl. And as I said, this works perfectly within Eclipse.
I am quite new with java and getting as far as I have with this has been a nightmare. Does anyone know what the problem could be here? Is there something I am forgetting to tell Eclipse when creating the .jar file? I have told it to package all external jars within the executable.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!