本文整理汇总了Java中com.sun.media.sound.RIFFReader类的典型用法代码示例。如果您正苦于以下问题:Java RIFFReader类的具体用法?Java RIFFReader怎么用?Java RIFFReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RIFFReader类属于com.sun.media.sound包,在下文中一共展示了RIFFReader类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readSoundbank
import com.sun.media.sound.RIFFReader; //导入依赖的package包/类
private void readSoundbank(InputStream inputstream) throws IOException {
RIFFReader riff = new RIFFReader(inputstream);
if (!riff.getFormat().equals("RIFF")) {
throw new RIFFInvalidFormatException(
"Input stream is not a valid RIFF stream!");
}
if (!riff.getType().equals("sfbk")) {
throw new RIFFInvalidFormatException(
"Input stream is not a valid SoundFont!");
}
while (riff.hasNextChunk()) {
RIFFReader chunk = riff.nextChunk();
if (chunk.getFormat().equals("LIST")) {
if (chunk.getType().equals("INFO"))
readInfoChunk(chunk);
if (chunk.getType().equals("sdta"))
readSdtaChunk(chunk);
if (chunk.getType().equals("pdta"))
readPdtaChunk(chunk);
}
}
}
示例2: readInfoChunk
import com.sun.media.sound.RIFFReader; //导入依赖的package包/类
private void readInfoChunk(RIFFReader riff) throws IOException {
while (riff.hasNextChunk()) {
RIFFReader chunk = riff.nextChunk();
String format = chunk.getFormat();
if (format.equals("ifil")) {
major = chunk.readUnsignedShort();
minor = chunk.readUnsignedShort();
} else if (format.equals("isng")) {
this.targetEngine = chunk.readString(chunk.available());
} else if (format.equals("INAM")) {
this.name = chunk.readString(chunk.available());
} else if (format.equals("irom")) {
this.romName = chunk.readString(chunk.available());
} else if (format.equals("iver")) {
romVersionMajor = chunk.readUnsignedShort();
romVersionMinor = chunk.readUnsignedShort();
} else if (format.equals("ICRD")) {
this.creationDate = chunk.readString(chunk.available());
} else if (format.equals("IENG")) {
this.engineers = chunk.readString(chunk.available());
} else if (format.equals("IPRD")) {
this.product = chunk.readString(chunk.available());
} else if (format.equals("ICOP")) {
this.copyright = chunk.readString(chunk.available());
} else if (format.equals("ICMT")) {
this.comments = chunk.readString(chunk.available());
} else if (format.equals("ISFT")) {
this.tools = chunk.readString(chunk.available());
}
}
}