A player for music file formats such as MIDI and iMelody.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- AVFoundation
Declaration
@interface AVMIDIPlayer : NSObject
A player for music file formats such as MIDI and iMelody.
SDKs
Framework
@interface AVMIDIPlayer : NSObject
- init With Contents Of URL: sound Bank URL: error:
Initializes a newly allocated MIDI player with the contents of the file specified by the URL, using the specified sound bank.
- init With Data: sound Bank URL: error:
Initializes a newly allocated MIDI player with the contents of the data object.
- prepare To Play
Prepares to play the sequence by prerolling all events.
- play:
Plays the sequence.
playing
A Boolean value that indicates whether the sequence is playing.
- stop
Stops playing the sequence.
duration
The length of the currently loaded file, in seconds.
current Position
The current playback position, in seconds.
rate
The playback rate of the player.
AVMIDIPlayer Completion Handler
A block to be called when a MIDI playback request is completed.
AVAudio Player
An audio player that provides playback of audio data from a file or memory.
AVAudio Recorder
A class that provides audio recording capability in your application.