summaryrefslogtreecommitdiffstats
path: root/src/demos/joal/SingleStaticSource.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-12-16 07:10:45 +0100
committerSven Gothel <[email protected]>2010-12-16 07:10:45 +0100
commit8707894cca0d462034241567e127cb9682d4ff3b (patch)
tree6025d844876668585740f6b3b08c413a97844729 /src/demos/joal/SingleStaticSource.java
parent06a03989dc067420124b3633905e84572244bf3b (diff)
Fix joal/gears applet demo
Diffstat (limited to 'src/demos/joal/SingleStaticSource.java')
-rwxr-xr-xsrc/demos/joal/SingleStaticSource.java12
1 files changed, 10 insertions, 2 deletions
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,