AudioServicesPlayAlertSoundWithCompletion

Function AudioServicesPlayAlertSoundWithCompletion 

Source
pub unsafe extern "C-unwind" fn AudioServicesPlayAlertSoundWithCompletion(
    in_system_sound_id: SystemSoundID,
    in_completion_block: Option<&DynBlock<dyn Fn()>>,
)
Available on crate features AudioServices and block2 only.
Expand description

Play an alert sound

Play the sound designated by the provided SystemSoundID with alert sound behavior.

Parameter inSystemSoundID: The SystemSoundID to be played. On the desktop the kSystemSoundID_UserPreferredAlert constant can be passed in to play back the alert sound selected by the user in System Preferences. On iOS there is no preferred user alert sound.

Parameter inCompletionBlock: The completion block gets executed for every attempt to play a system sound irrespective of success or failure. The callbacks are issued on a serial queue and the client is responsible for handling thread safety.