From d450c6fc9373ab772325ea42c48b1fb89cb1e3f2 Mon Sep 17 00:00:00 2001 From: TK Lam Date: Wed, 19 Sep 2018 22:52:22 +0800 Subject: [PATCH] fix buffer size bug --- .../semantive/waveformandroid/waveform/soundfile/CheapWAV.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapWAV.java b/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapWAV.java index 1a34b88..6b6dd37 100644 --- a/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapWAV.java +++ b/library/src/main/java/com/semantive/waveformandroid/waveform/soundfile/CheapWAV.java @@ -97,7 +97,7 @@ public void ReadFile(File inputFile) throws java.io.IOException { mChannels = wavFile.getNumChannels(); int gain, value; - int[] buffer = new int[getSamplesPerFrame()]; + int[] buffer = new int[getSamplesPerFrame()*mChannels]; for (int i = 0; i < mNumFrames; i++) { gain = -1; wavFile.readFrames(buffer, getSamplesPerFrame());