<Sound Dev>  Review Request: 8038139 AudioInputStream.getFrameLength() returns wrong value for floating-point WAV
philip.race at oracle.com
Fri Feb 5 20:11:55 UTC 2016
On 02/05/2016 09:20 AM, Sergey Bylokhov wrote:
> Hello, Audio Guru.
> Please review the fix for jdk9.
> There are two bugs in this area:
> - in the WaveExtensibleFileReader.java/WaveFloatFileReader.java we
> create the AudioInputStream using the data size in bytes instead of
> the the size in frames. In the fix the size in bytes is divided by the
> size of the frame.
> - in AiffFileWriter.java we incorrectly calculate the data size in
> bytes(for example if the sample size is less than 8). instead of
> numFrames * channels * sampleSize / 8
> it should be
> numFrames * channels * ((sampleSize + 7) / 8)
> And when later we read this data in AiffFilereader we incorrectly
> calculate the FrameLength.
> In the test I created some fake stream and converted it to a different
> formats with expectation that FrameLength will be preserved.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8038139
> Webrev can be found at:
More information about the sound-dev