From 52ae4377ddc9676fda5eb8f9ac5d93b0521e8aba Mon Sep 17 00:00:00 2001 From: Matthew Harris Date: Wed, 6 Jan 2016 16:28:32 +0100 Subject: Ensure that only the size of sample data chunk is loaded, rather than entire remaining buffer. Copes with WAV files that have metadata appended to the end after the data RIFF chunk. --- src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java | 8 ++++---- src/test/com/jogamp/openal/test/manual/OpenALTest.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java b/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java index 29035da..1e6f30f 100644 --- a/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java +++ b/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java @@ -41,19 +41,19 @@ public class ALutWAVLoaderTest extends UITestCase { @Test public void testWAVDataLoadStream() throws IOException { - final WAVData wd0 = WAVData.loadFromStream(ResourceLocation.getTestStream0(), ResourceLocation.getTestStream0Size(), 1, 8, 22050, ByteOrder.LITTLE_ENDIAN, true); + final WAVData wd0 = WAVData.loadFromStream(ResourceLocation.getTestStream0(), ResourceLocation.getTestStream0Size(), 1, 8, 22050, ByteOrder.LITTLE_ENDIAN, true, 0); System.out.println("*** WAVData.loadFrom Stream0 size "+wd0.data.limit()); assertEquals(wd0.data.limit(), ResourceLocation.getTestStream0Size()); - final WAVData wd1 = WAVData.loadFromStream(ResourceLocation.getTestStream1(), ResourceLocation.getTestStream1Size(), 2, 16, 44100, ByteOrder.BIG_ENDIAN, true); + final WAVData wd1 = WAVData.loadFromStream(ResourceLocation.getTestStream1(), ResourceLocation.getTestStream1Size(), 2, 16, 44100, ByteOrder.BIG_ENDIAN, true, 0); System.out.println("*** WAVData.loadFrom Stream1 size "+wd1.data.limit()); assertEquals(wd1.data.limit(), ResourceLocation.getTestStream1Size()); - final WAVData wd2 = WAVData.loadFromStream(ResourceLocation.getTestStream2(), ResourceLocation.getTestStream2Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true); + final WAVData wd2 = WAVData.loadFromStream(ResourceLocation.getTestStream2(), ResourceLocation.getTestStream2Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true, 0); System.out.println("*** WAVData.loadFrom Stream2 size "+wd2.data.limit()); assertEquals(wd2.data.limit(), ResourceLocation.getTestStream2Size()); - final WAVData wd3 = WAVData.loadFromStream(ResourceLocation.getTestStream3(), ResourceLocation.getTestStream3Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true); + final WAVData wd3 = WAVData.loadFromStream(ResourceLocation.getTestStream3(), ResourceLocation.getTestStream3Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true, 0); System.out.println("*** WAVData.loadFrom Stream3 size "+wd3.data.limit()); assertEquals(wd3.data.limit(), ResourceLocation.getTestStream3Size()); diff --git a/src/test/com/jogamp/openal/test/manual/OpenALTest.java b/src/test/com/jogamp/openal/test/manual/OpenALTest.java index 1981326..9b48560 100644 --- a/src/test/com/jogamp/openal/test/manual/OpenALTest.java +++ b/src/test/com/jogamp/openal/test/manual/OpenALTest.java @@ -102,7 +102,7 @@ public class OpenALTest { // WAVData wd = WAVData.loadFromStream(ResourceLocation.getTestStream0(), ResourceLocation.getTestStream0Size(), 1, 8, 22050, ByteOrder.LITTLE_ENDIAN, true); // WAVData wd = WAVData.loadFromStream(ResourceLocation.getTestStream1(), ResourceLocation.getTestStream1Size(), 2, 16, 44100, ByteOrder.BIG_ENDIAN, true); - final WAVData wd = WAVData.loadFromStream(ResourceLocation.getTestStream2(), ResourceLocation.getTestStream2Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true); + final WAVData wd = WAVData.loadFromStream(ResourceLocation.getTestStream2(), ResourceLocation.getTestStream2Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true, 0); // WAVData wd = WAVData.loadFromStream(ResourceLocation.getTestStream3(), ResourceLocation.getTestStream3Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true); System.out.println("*** size "+wd.data.limit()); -- cgit v1.2.3