init(audioResourceID:parameters:relativeTime:duration:)
Initializes a haptic event from a previously loaded audio resource, specifying event parameters, start time, and duration.
Declaration
init(audioResourceID resID: CHHapticAudioResourceID, parameters eventParams: [CHHapticEventParameter], relativeTime time: TimeInterval, duration: TimeInterval)Parameters
- resID:
The resource ID of the accompanying audio signal.
- eventParams:
An array of event parameters to characterize the audio event.
- time:
The start time of the audio event, in seconds.
- duration:
The duration of the audio event, in seconds.
Discussion
To register an audio resource, call the CHHapticEngine object’s registerAudioResource(_:options:) method.