当前位置: 首页>>代码示例>>Java>>正文


Java RIFFReader类代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:23,代码来源:SF2Soundbank.java

示例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());
        }

    }
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:33,代码来源:SF2Soundbank.java


注:本文中的com.sun.media.sound.RIFFReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。