如何控制 MIDI 音序器的音量?
我希望音量淡出并关闭,而不是一切都自动停止。
if (musicSr != null)
{
musicSr.stop();
musicSr.close();
musicSr = null;
musicS = null;
File music = new File(midi);
if(music.exists())
{
musicS = MidiSystem.getSequence(music);
}
// Create a sequencer for the sequence
musicSr = MidiSystem.getSequencer();
musicSr.open();
musicSr.setSequence(musicS);
musicSr.setLoopCount(Sequencer.LOOP_CONTINUOUSLY);
musicSr.start();
}