<Sound Dev> [9] Review Request: 8064800 AudioSystem/WaveFileWriter can't write PCM_FLOAT, but writes it anyway

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Thu Jan 7 20:49:12 UTC 2016

Hello, Audio Guru.

Please review the fix for jdk9.

Support of the PCM_FLOAT encoding was added to the jdk7, but some 
important things were forgotten:
  - The new WaveFloatFileWriter.java was not added to the 
./services/javax.sound.sampled.spi.AudioFileWriter, which means that it 
is never used by the java sound.
- The old writers(AiffFileWriter, AuFileWriter, WaveFileWriter) was 
written in an assumption that they support all possible encoding.

  - In the fix I reused isFileTypeSupported() method which checks the 
encoding of the stream.
  - In the test some of the data are commented or skipped: for example 
we support float&32bits only but we do not check this in the 
isFileTypeSupported. Same for "channels = AudioSystem.NOT_SPECIFIED" the 
isFileTypeSupported() returns true but write() method fails, etc. I plan 
to fix it separately.

+cleanup of the related methods in AudioSystem.java.

Bug: https://bugs.openjdk.java.net/browse/JDK-8064800
Webrev can be found at: http://cr.openjdk.java.net/~serb/8064800/webrev.00

Best regards, Sergey.

More information about the sound-dev mailing list