Contents

start(completion:)

Invokes the sound event and runs the specified code on completion.

Declaration

func start(completion handler: (@Sendable (PHASESoundEvent.StartHandlerReason) -> Void)? = nil)
func start() async -> PHASESoundEvent.StartHandlerReason

Mentioned in

Discussion

This function returns immediately after instructing the engine to invoke the sound event. If a problem occurs, the function provides an error.

The sound event’s audio plays immediately if the app prepares the sound event in advance. Otherwise, the sound event begins preparing and then plays after preparation completes.

When the sound event plays or errors out, the framework invokes completionHandler, passing in a PHASESoundEvent.StartHandlerReason that explains the reason for the invocation.

See Also

Starting Playback