Instance Method

registerAudioResource:options:error:

Registers an external audio file for use as a custom waveform.

Declaration

- (CHHapticAudioResourceID)registerAudioResource:(NSURL *)resourceURL options:(NSDictionary *)options error:(NSError * _Nullable *)outError;

Parameters

resourceID

The ID of the audio resource you'd like to register.

outError

An error that contains information about failed resource registration, or nil if no error occurred.

Discussion

Before you initialize a Core Haptics event with your own audio file, use this method to register that file. External audio files are referenced via URL.

Input the value that this method returns when creating the dictionary or event representation of a haptic pattern.

See Also

Registering Audio Resources

- unregisterAudioResource:error:

Unregisters a previously registered external audio file.

CHHapticAudioResourceID

A type alias used to register an ID for a custom audio resource.