@Override
public AudioInputStream getAudioInputStream(final InputStream stream)
throws UnsupportedAudioFileException, IOException {
final StandardFileFormat format = getAudioFileFormat(stream);
final AudioFormat af = format.getFormat();
final long length = format.getLongFrameLength();
// 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")) {
return new AudioInputStream(chunk, af, length);
}
}
throw new UnsupportedAudioFileException();
}
WaveExtensibleFileReader.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:openjdk-jdk10
作者:
评论列表
文章目录