use of com.xenoage.zong.io.midi.out.MidiSequence in project Zong by Xenoage.
the class WavScoreFileOutput method writeWav.
/**
* Writes the given score as a WAV file into the given stream.
*/
public static void writeWav(Score score, OutputStream stream) throws IOException {
// save WAVE file
try {
// create midi sequence
MidiSequence<Sequence> sequence = MidiConverter.convertToSequence(score, optionsForFileExport, new JseMidiSequenceWriter());
// for all instruments
MidiToWaveRenderer.render(SynthManager.getSoundbank(), sequence.getSequence(), null, new JseOutputStream(stream));
} catch (Exception ex) {
INSTANCE.log(Companion.warning(ex));
throw new IOException(ex);
}
}
Aggregations