diff options
-rw-r--r-- | jnlp-files/applet-gearsjoal.jnlp | 1 | ||||
-rwxr-xr-x | src/demos/data/sound/FancyPants.wav | bin | 0 -> 58986 bytes | |||
-rwxr-xr-x | src/demos/joal/SingleStaticSource.java | 12 |
3 files changed, 11 insertions, 2 deletions
diff --git a/jnlp-files/applet-gearsjoal.jnlp b/jnlp-files/applet-gearsjoal.jnlp index 0ffe065..d8745d7 100644 --- a/jnlp-files/applet-gearsjoal.jnlp +++ b/jnlp-files/applet-gearsjoal.jnlp @@ -14,6 +14,7 @@ <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/> <property name="sun.java2d.noddraw" value="true"/> <jar href="jogl-demos.jar" main="true"/> + <jar href="jogl-demos-data.jar"/> <jar href="jogl-demos-util.jar"/> <extension name="newt-all-awt" href="JOGL_CODEBASE_TAG/newt-all-awt.jnlp" version="JOGAMP_VERSION" /> <extension name="joal" href="JOAL_CODEBASE_TAG/joal.jnlp" version="JOGAMP_VERSION" /> diff --git a/src/demos/data/sound/FancyPants.wav b/src/demos/data/sound/FancyPants.wav Binary files differnew file mode 100755 index 0000000..712a3c6 --- /dev/null +++ b/src/demos/data/sound/FancyPants.wav diff --git a/src/demos/joal/SingleStaticSource.java b/src/demos/joal/SingleStaticSource.java index b6b8ccf..0056a97 100755 --- a/src/demos/joal/SingleStaticSource.java +++ b/src/demos/joal/SingleStaticSource.java @@ -55,6 +55,7 @@ import javax.swing.*; */ public class SingleStaticSource { + static final String audioFile = "demos/data/sound/FancyPants.wav"; public SingleStaticSource(boolean gui) { this(gui, null, true); @@ -225,11 +226,18 @@ public class SingleStaticSource { // Load wav data into a buffer. al.alGenBuffers(1, buffer, 0); - if (al.alGetError() != AL.AL_NO_ERROR) + if (al.alGetError() != AL.AL_NO_ERROR) { throw new ALException("Error generating OpenAL buffers"); + } + + InputStream stream = SingleStaticSource.class.getClassLoader().getResourceAsStream(audioFile); + if(null == stream) { + throw new RuntimeException("File '"+audioFile+"' not found"); + } + System.err.println("File "+audioFile+" opened"); ALut.alutLoadWAVFile( - SingleStaticSource.class.getClassLoader().getResourceAsStream("demos/data/FancyPants.wav"), + stream, format, data, size, |