-
Bug
-
Resolution: Unresolved
-
P4
-
7u51
-
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 :
When writing a WAV file with floating-point audio data, the incorrect encoding type for integer PCM data is written to the WAV file header.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The test program below can be used to copy a floating-point WAV file. The output file written by the program will have the wrong encoding. When the output file is opened with an audio editor, a corrupt audio signal is displayed, because the floating point audio data is interpreted as integer data.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
public class TestWavFloatBug2 {
public static void main(String[] args) throws Exception {
String inputFileName = args[0];
String outputFileName = args[1];
AudioInputStream stream = AudioSystem.getAudioInputStream(new File(inputFileName));
AudioSystem.write(stream, AudioFileFormat.Type.WAVE, new File(outputFileName));
}
}
---------- 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 :
When writing a WAV file with floating-point audio data, the incorrect encoding type for integer PCM data is written to the WAV file header.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The test program below can be used to copy a floating-point WAV file. The output file written by the program will have the wrong encoding. When the output file is opened with an audio editor, a corrupt audio signal is displayed, because the floating point audio data is interpreted as integer data.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
public class TestWavFloatBug2 {
public static void main(String[] args) throws Exception {
String inputFileName = args[0];
String outputFileName = args[1];
AudioInputStream stream = AudioSystem.getAudioInputStream(new File(inputFileName));
AudioSystem.write(stream, AudioFileFormat.Type.WAVE, new File(outputFileName));
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8038139 AudioInputStream.getFrameLength() returns wrong value for floating-point WAV
-
- Resolved
-