diff options
author | Sven Gothel <[email protected]> | 2013-02-01 02:34:39 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-01 02:34:39 +0100 |
commit | d0506f51c85efdcce1d48f58f95e57d48d22742e (patch) | |
tree | 586946c694853d5afd27197d7156bbccd770e6af /src/java/com/jogamp/openal/util/WAVLoader.java | |
parent | 98d08ccfc26ead15746bee6f4626d2daac4989d4 (diff) |
WavData.loadFromStream: Uses IOUtil.copyStream2ByteBuffer which fixes loading on Android; Adding proper byteOrder swapping depending on input format.
- Also added a few more test streams
- Working Android test activity
Diffstat (limited to 'src/java/com/jogamp/openal/util/WAVLoader.java')
-rw-r--r-- | src/java/com/jogamp/openal/util/WAVLoader.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/java/com/jogamp/openal/util/WAVLoader.java b/src/java/com/jogamp/openal/util/WAVLoader.java index 40ad99e..f997eb4 100644 --- a/src/java/com/jogamp/openal/util/WAVLoader.java +++ b/src/java/com/jogamp/openal/util/WAVLoader.java @@ -37,6 +37,7 @@ package com.jogamp.openal.util; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.nio.ByteOrder; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -103,7 +104,9 @@ public class WAVLoader { private static WAVData loadFromStreamImpl(AudioInputStream aIn) throws UnsupportedAudioFileException, IOException { final AudioFormat fmt = aIn.getFormat(); - return WAVData.loadFromStream(aIn, fmt.getChannels(), fmt.getSampleSizeInBits(), Math.round(fmt.getSampleRate())); + return WAVData.loadFromStream(aIn, -1, fmt.getChannels(), fmt.getSampleSizeInBits(), + Math.round(fmt.getSampleRate()), + fmt.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN, false); } } |