Protocol AVAudio Player Delegate
A protocol that allows a delegate to respond to audio interruptions and audio decoding errors, and to the completion of a sound’s playback.
iOS 2.2+ macOS 10.7+ Mac Catalyst 13.0+ Beta tvOS 9.0+ watchOS 3.0+ Declaration @protocol AVAudioPlayerDelegate
The delegate of an
object must adopt the
protocol. All of the methods in this protocol are optional.
AVAudio Player Delegate Topics Responding to Sound Playback Completion Responding to an Audio Decoding Error Handling Audio Interruptions See Also Configuring and Controlling Playback - play
Plays a sound asynchronously.
- play At Time:
Plays a sound asynchronously, starting at a specified point in the audio output device’s timeline.
Pauses playback; sound remains ready to resume playback from where it left off.
Stops playback and undoes the setup needed for playback.
- prepare To Play
Prepares the audio player for playback by preloading its buffers.
A Boolean value that indicates whether the audio player is playing (
) or not (
The playback volume for the audio player, ranging from
on a linear scale.
1 .0 pan
The audio player’s stereo pan position.
The audio player’s playback rate.
A Boolean value that specifies whether playback rate adjustment is enabled for an audio player.
number Of Loops
The number of times a sound will return to the beginning, upon reaching the end, to repeat playback.
The delegate object for the audio player.
The audio player’s settings dictionary, containing information about the sound associated with the player.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
Learn more about using Apple's beta software