Can AudioTrack play MIDI files?
Can AudioTrack play MIDI files?
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.
Please read the docs : developer.android.com/reference/android/media/AudioTrack.html
– 2Dee
Nov 21 '13 at 8:54
Thank you Michael and 2Dee for you're answer.
– M2Midnight
Nov 21 '13 at 14:34
2 Answers
2
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.
Can JetPlayer control the tempo (or speed) of MIDI file?
– M2Midnight
Nov 21 '13 at 14:39
A good sample code to play MIDI file with Audio player in Android...
Hope it helps you .. :)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
– CL.
Nov 21 '13 at 9:22
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
"can AudioTrack Android play MIDI file?", No. It plays uncompressed PCM.
– Michael
Nov 21 '13 at 8:37