Determining the Duration of a Midi Audio File
import javax.sound.midi.MidiSystem; import javax.sound.midi.Sequencer; public class Main { public static void main(String[] argv) throws Exception { Sequencer sequencer = MidiSystem.getSequencer(); sequencer.open(); double durationInSecs = sequencer.getMicrosecondLength() / 1000000.0; } }