I could play MIDI file where "filename" is a String type with "asd.mid" value. However, I tried to sent AIR's nativeprocess command to Java, it shown "could not read" error. How come?
Java:
private void playMidi() {
if(isPlaying.equals("0")) {
try {
song = MidiSystem.getSequence(new File(filename));
sequencer = MidiSystem.getSequencer();
sequencer.setSequence(song);
sequencer.open();
sequencer.addMetaEventListener(this);
sequencer.start();
} catch (InvalidMidiDataException e) {
System.out.println("Bad midi file: "+ filename);
System.exit(1);
} catch (MidiUnavailableException e) {System.out.println("No sequencer available");
System.exit(1);
} catch (IOException e) {System.out.println("Could not read: "+ filename);
System.exit(1);
}
displayMidiInfo(filename);
} else {
updateTempoFactor(speed);
}
}