Hi all,
is there any way to load a .wav from a jar file or input stream using ALut ?
I am asking because the method alutUnloadWAV only accepts a string.
Or is there a trick to convert the resource url to a string, that can be used?
I tried the following, but it didn’t work.
java.net.URL url = ClassLoader.getSystemResource(“MySound.wav”);
// works well
java.io.InputStream in = url.openStream();
in.read();
…
in.close();
// but I can’t use the file location as an argument to an FileInpuStream -
the exception:thrown, is listed below
ALut.alutLoadWAVFile( url.getFile(), …);
java.io.FileNotFoundException: file:/home/gestalt/code/projects/beergarden/dist/beergarden.jar!/FancyPants.wav (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:106)
at com.sun.media.sound.WaveFileReader.getAudioInputStream(WaveFileReader.java:205)
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1162)
at net.java.games.joal.util.WAVLoader.loadFromFile(WAVLoader.java:76)
at net.java.games.joal.util.ALut.alutLoadWAVFile(ALut.java:101)
at net.monoid.beergarden.RendererAL.loadALData(RendererAL.java:138)
at net.monoid.beergarden.RendererAL.(RendererAL.java:77)
at net.monoid.beergarden.Main.main(Main.java:34)