How to play .mid file?
ghopretz opened this issue · 2 comments
ghopretz commented
How to play .mid file with this library?
francollamas commented
Hi! I was trying to undestand it...
You need to add the MidiDevice to MidiSystem....
Next.. load a Secuence and put it into a Secuencer.....
Using the synth of the example module:
MidiSystem.addMidiDevice(synth);
InputStream is = context.getAssets().open("midi file dir here!");
StandardMidiFileReader fileReader = new StandardMidiFileReader();
Sequence s = fileReader.getSequence(is);
Sequencer sequencer = MidiSystem.getSequencer();
sequencer.open();
sequencer.setSequence(s);
sequencer.start();
zhiqinliao commented
o, this way can't working