Contents

AudioServicesSystemSoundCompletionProc

A function the system invokes when a system sound finishes playing.

Declaration

typealias AudioServicesSystemSoundCompletionProc = (SystemSoundID, UnsafeMutableRawPointer?) -> Void

Parameters

  • ssID:

    The system sound that has finished playing.

  • clientData:

    App data that you specified when registering the callback function.

Discussion

Because a system sound may play for up to 30 seconds, the AudioServicesPlaySystemSound(_:) function executes asynchronously (that is, it returns immediately), and calls this function when the sound finishes playing. You can use this callback, for example, to help you avoid playing a second sound while a first sound is still playing.

See Also

Adding and Removing System Sound Callbacks