I have a exported Jar that loads WAV files through this method:
public void loadSound(String path) throws FileNotFoundException {
WaveData data = null;
data = WaveData.create(GameSound.class.getClassLoader().getResourceAsStream(path));
int buffer = alGenBuffers();
alBufferData(buffer, data.format, data.data, data.samplerate);
data.dispose();
source = alGenSources();
alSourcei(source, AL_BUFFER, buffer);
}
The sound files I’m trying to load are in the same package as the class that the above method is in. I’ve tried to use all sorts of ways to load the WaveData, but none of them work after exporting; they all return a NPE or file not found. Has anyone here used OpenAL? How do I get the files in the same package after exporting? I guess this is a newbie issue because it is just file handling, but I never took the time to learn the difference between a lot of the Java IO functions…