How to put the midi and recorded audio file into a single player?

The GarageBand app can import both midi and recorded audio file into a single player to play.

Just like this:

My App have the same feature but I don't know how to implement it.

  • I have tried the AVAudioSequencer,but it only can load and play MIDI file.
  • I have tried the AVPlayer and AVPlayerItem,but it seems that it can't load the MIDI file.

So How to combine MIDI file and audio file into a single AVPlayerItem or anything else to play?

How to put the midi and recorded audio file into a single player?
 
 
Q