<Sound Dev> [9] Review Request: 8146239 Support of PCM_FLOAT for the AU file format

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Fri Feb 26 13:17:05 UTC 2016


Hello, Audio Guru.

Please review the small fix for jdk9.

According to specification [1] AU file format can contains the data in 
the float encoding. When support of AU was added to the jdk the float 
encoding was not supported. But in jdk 7 PCM_FLOAT was added(for WAV) 
and it can be reused for AU as well.

Changes description:
  1) AuFileFormat.java/AuFileReader.java: the pcm_float was added to the 
switches.
  2) AuFileWriter.java:
    - The "if" statement in getAudioFileFormat() was reworked. Its 
purpose was to change the type PCM_UNSIGNED to PCM_SIGNED(because au 
support only signed pcm). But it was written in some strange manner. 
Note that this method returns the type which should be used in the saved 
audio file.
    - In the getFileStream() I removed the checks and always converts 
the input stream to the AudioFileFormat which was returned from the 
getAudioFileFormat() and the AudioSystem.getAudioInputStream() will 
recognize conversion is needed or not

[1] http://www-mmsp.ece.mcgill.ca/documents/audioformats/AU/AU.html

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

-- 
Best regards, Sergey.


More information about the sound-dev mailing list