Reputation: 76
G'day! I've been doing a prototype where I need to play a MIDI file and change the playing rate from time to time. I first tried this in iOS with its AVMIDIPlayer, and it worked relatively well. Now I'm trying it with Android's MediaPlayer, and here's my code to change the rate:
public void speedUp(View view) {
params.setPitch(1.0f);
params.setSpeed(1.8f);
player.setPlaybackParams(params);
}
The rate did change as I expected, but at the same time, the sound quality became HORRIBLE. I'm wondering, is this the right way to do this in Android, please? If so, what mistake(s) have I made? If not, what are some better ways?
After some research, I'm going to conclude that Android has no official MIDI sequencer. Is this correct?
Upvotes: 1
Views: 42
Reputation: 1998
Check out Android MIDI Library. It's a bit verbose but allows you to do all kinds of things.
Upvotes: 1