< prev index next >

src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java

Print this page

        

*** 93,112 **** @Override public AudioInputStream getAudioInputStream(final InputStream stream) throws UnsupportedAudioFileException, IOException { ! AudioFileFormat format = getAudioFileFormat(stream); // we've got everything, the stream is supported and it is at the // beginning of the header, so find the data chunk again and return an // AudioInputStream ! RIFFReader riffiterator = new RIFFReader(stream); while (riffiterator.hasNextChunk()) { RIFFReader chunk = riffiterator.nextChunk(); if (chunk.getFormat().equals("data")) { ! return new AudioInputStream(chunk, format.getFormat(), ! chunk.getSize()); } } throw new UnsupportedAudioFileException(); } } --- 93,113 ---- @Override public AudioInputStream getAudioInputStream(final InputStream stream) throws UnsupportedAudioFileException, IOException { ! final AudioFileFormat format = getAudioFileFormat(stream); // we've got everything, the stream is supported and it is at the // beginning of the header, so find the data chunk again and return an // AudioInputStream ! final RIFFReader riffiterator = new RIFFReader(stream); while (riffiterator.hasNextChunk()) { RIFFReader chunk = riffiterator.nextChunk(); if (chunk.getFormat().equals("data")) { ! final AudioFormat af = format.getFormat(); ! final long length = chunk.getSize() / af.getFrameSize(); ! return new AudioInputStream(chunk, af, length); } } throw new UnsupportedAudioFileException(); } }
< prev index next >