-
Bug
-
Resolution: Fixed
-
P4
-
7u51
-
b110
-
x86_64
-
windows_7
FULL PRODUCT VERSION :
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
A DESCRIPTION OF THE PROBLEM :
For WAV files containing floating-point audio data, AudioInputStream.getFrameLength() returns the number of bytes instead of the number of 32-bit sample frames.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test program below with a WAV file containing floating-point audio data.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
AudioInputStream.getFrameLength() should return the number of sample frames, as it does for WAV files containing integer PCM data.
ACTUAL -
AudioInputStream.getFrameLength() returns the number of bytes, when the WAV file contains floating-point audio data.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
public class TestWavFloatBug1 {
public static void main(String[] args) throws Exception {
String inputFileName = args[0];
AudioInputStream stream = AudioSystem.getAudioInputStream(new File(inputFileName));
System.out.println(stream.getFrameLength());
}
}
---------- END SOURCE ----------
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
A DESCRIPTION OF THE PROBLEM :
For WAV files containing floating-point audio data, AudioInputStream.getFrameLength() returns the number of bytes instead of the number of 32-bit sample frames.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test program below with a WAV file containing floating-point audio data.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
AudioInputStream.getFrameLength() should return the number of sample frames, as it does for WAV files containing integer PCM data.
ACTUAL -
AudioInputStream.getFrameLength() returns the number of bytes, when the WAV file contains floating-point audio data.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
public class TestWavFloatBug1 {
public static void main(String[] args) throws Exception {
String inputFileName = args[0];
AudioInputStream stream = AudioSystem.getAudioInputStream(new File(inputFileName));
System.out.println(stream.getFrameLength());
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8038138 Writing a floating-point WAV file stores the wrong encoding type in the header
-
- Open
-