com.sun.media.sound.RIFFWriter Java Examples
The following examples show how to use
com.sun.media.sound.RIFFWriter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 6 votes |
private void writeInfo(RIFFWriter writer) throws IOException { if (this.targetEngine == null) this.targetEngine = "EMU8000"; if (this.name == null) this.name = ""; RIFFWriter ifil_chunk = writer.writeChunk("ifil"); ifil_chunk.writeUnsignedShort(this.major); ifil_chunk.writeUnsignedShort(this.minor); writeInfoStringChunk(writer, "isng", this.targetEngine); writeInfoStringChunk(writer, "INAM", this.name); writeInfoStringChunk(writer, "irom", this.romName); if (romVersionMajor != -1) { RIFFWriter iver_chunk = writer.writeChunk("iver"); iver_chunk.writeUnsignedShort(this.romVersionMajor); iver_chunk.writeUnsignedShort(this.romVersionMinor); } writeInfoStringChunk(writer, "ICRD", this.creationDate); writeInfoStringChunk(writer, "IENG", this.engineers); writeInfoStringChunk(writer, "IPRD", this.product); writeInfoStringChunk(writer, "ICOP", this.copyright); writeInfoStringChunk(writer, "ICMT", this.comments); writeInfoStringChunk(writer, "ISFT", this.tools); writer.close(); }
Example #2
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 6 votes |
private void writeGenerators(RIFFWriter writer, Map<Integer, Short> generators) throws IOException { Short keyrange = (Short) generators.get(SF2Region.GENERATOR_KEYRANGE); Short velrange = (Short) generators.get(SF2Region.GENERATOR_VELRANGE); if (keyrange != null) { writer.writeUnsignedShort(SF2Region.GENERATOR_KEYRANGE); writer.writeShort(keyrange); } if (velrange != null) { writer.writeUnsignedShort(SF2Region.GENERATOR_VELRANGE); writer.writeShort(velrange); } for (Map.Entry<Integer, Short> generator : generators.entrySet()) { if (generator.getKey() == SF2Region.GENERATOR_KEYRANGE) continue; if (generator.getKey() == SF2Region.GENERATOR_VELRANGE) continue; writer.writeUnsignedShort(generator.getKey()); writer.writeShort(generator.getValue()); } }
Example #3
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 5 votes |
private void writeInfoStringChunk(RIFFWriter writer, String name, String value) throws IOException { if (value == null) return; RIFFWriter chunk = writer.writeChunk(name); chunk.writeString(value); int len = value.getBytes("ascii").length; chunk.write(0); len++; if (len % 2 != 0) chunk.write(0); }
Example #4
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 5 votes |
private void writeModulators(RIFFWriter writer, List<SF2Modulator> modulators) throws IOException { for (SF2Modulator modulator : modulators) { writer.writeUnsignedShort(modulator.sourceOperator); writer.writeUnsignedShort(modulator.destinationOperator); writer.writeShort(modulator.amount); writer.writeUnsignedShort(modulator.amountSourceOperator); writer.writeUnsignedShort(modulator.transportOperator); } }
Example #5
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 4 votes |
public void save(String name) throws IOException { writeSoundbank(new RIFFWriter(name, "sfbk")); }
Example #6
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 4 votes |
public void save(File file) throws IOException { writeSoundbank(new RIFFWriter(file, "sfbk")); }
Example #7
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 4 votes |
public void save(OutputStream out) throws IOException { writeSoundbank(new RIFFWriter(out, "sfbk")); }
Example #8
Source File: SF2Soundbank.java From tuxguitar with GNU Lesser General Public License v2.1 | 4 votes |
private void writeSoundbank(RIFFWriter writer) throws IOException { writeInfo(writer.writeList("INFO")); writeSdtaChunk(writer.writeList("sdta")); writePdtaChunk(writer.writeList("pdta")); writer.close(); }