Class

AVMIDIPlayer

The AVMIDIPlayer class is a player for music file formats such as MIDI and iMelody.

Symbols

Creating a MIDI Player

init(contentsOf: URL, soundBankURL: URL?)

Initializes a newly allocated MIDI player with the contents of the file specified by the URL, using the specified sound bank.

init(data: Data, soundBankURL: URL?)

Initializes a newly allocated MIDI player with the contents of the data object.

Playing Content

func prepareToPlay()

Prepares to play the sequence by prerolling all events.

var isPlaying: Bool

Whether the sequence is playing.

func stop()

Stops playing the sequence.

var duration: TimeInterval

The length of the currently loaded file, in seconds.

var currentPosition: TimeInterval

The current playback position, in seconds.

var rate: Float

The playback rate of the player.

Constants

AVMIDIPlayerCompletionHandler

A block to be called when a MIDI playback request is completed.

Relationships

Inherits From

Conforms To