问题
I want to know can AudioTrack Android play MIDI file?
If not, which library can. Because I want the Android library which can play and control tempo of MIDI file for my app.
回答1:
Check Android Supported media format from here Android Media Support. MIDI playback support is built-in in Android. Playing MIDI file using JetPlayer is very much handy in android. To play MIDI file you have to write code of below :
JetPlayer jetPlayer = JetPlayer.getJetPlayer();
jetPlayer.loadJetFile("/sdcard/level1.jet");
byte segmentId = 0;
// queue segment 5, repeat once, use General MIDI, transpose by -1 octave
jetPlayer.queueJetSegment(5, -1, 1, -1, 0, segmentId++);
jetPlayer.play();
For details check Example 1 & Example 2. And here is the jet creator manual which will provide you the details background process of JetPlayer.
回答2:
A good sample code to play MIDI file with Audio player in Android...
Hope it helps you .. :)
来源:https://stackoverflow.com/questions/20115908/can-audiotrack-play-midi-files