Name: rmT116609 Date: 07/24/2003
FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
FULL OPERATING SYSTEM VERSION :Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The method getFrameLength of class
javax.sound.sampled.AudioInputStream returns twice the
number that it should for a stream created from an AIFF
file containing 12-bit samples.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run the program below.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.AudioInputStream;
/**
* Demonstrates a bug in <code>AudioInputStream.getFrameLength</code>,
* which returns twice what it should for a stream created from a 12-bit
* AIFF file. The file sampleSize12.aif is a single-channel AIFF file
* containing 100 samples, with values 0 through 99. It is available at
* http://www.birds.cornell.edu/brp/HaroldMills/JavaSoundBug1.html.
*/
public class SampleSizeBug {
public static void main(String[] inArgs) throws Exception {
File file = new File("sampleSize12.aiff");
AudioInputStream stream = AudioSystem.getAudioInputStream(file);
System.out.println("number of sample frames " + stream.getFrameLength
());
}
}
---------- END SOURCE ----------
(Incident Review ID: 173352)
======================================================================