Class FBHapticPcm
This extension enables applications to trigger haptic effects using Pulse Code Modulation (PCM) buffers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intAPI Constantsstatic final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrGetDeviceSampleRateFB(XrSession session, long hapticActionInfo, long deviceSampleRate) Unsafe version of:GetDeviceSampleRateFBstatic intxrGetDeviceSampleRateFB(XrSession session, XrHapticActionInfo hapticActionInfo, XrDevicePcmSampleRateGetInfoFB deviceSampleRate) Get device sample rate.
-
Field Details
-
XR_FB_haptic_pcm_SPEC_VERSION
public static final int XR_FB_haptic_pcm_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_FB_HAPTIC_PCM_EXTENSION_NAME
The extension name.- See Also:
-
XR_TYPE_HAPTIC_PCM_VIBRATION_FB
public static final int XR_TYPE_HAPTIC_PCM_VIBRATION_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_DEVICE_PCM_SAMPLE_RATE_STATE_FB
public static final int XR_TYPE_DEVICE_PCM_SAMPLE_RATE_STATE_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_DEVICE_PCM_SAMPLE_RATE_GET_INFO_FB
public static final int XR_TYPE_DEVICE_PCM_SAMPLE_RATE_GET_INFO_FBExtendsXrStructureType.Enum values:
- See Also:
-
XR_MAX_HAPTIC_PCM_BUFFER_SIZE_FB
public static final int XR_MAX_HAPTIC_PCM_BUFFER_SIZE_FBAPI Constants- See Also:
-
-
Method Details
-
nxrGetDeviceSampleRateFB
public static int nxrGetDeviceSampleRateFB(XrSession session, long hapticActionInfo, long deviceSampleRate) Unsafe version of:GetDeviceSampleRateFB -
xrGetDeviceSampleRateFB
public static int xrGetDeviceSampleRateFB(XrSession session, XrHapticActionInfo hapticActionInfo, XrDevicePcmSampleRateGetInfoFB deviceSampleRate) Get device sample rate.C Specification
XrResult xrGetDeviceSampleRateFB( XrSession session, const XrHapticActionInfo* hapticActionInfo, XrDevicePcmSampleRateGetInfoFB* deviceSampleRate);Description
The runtime must use the
hapticActionInfoto get the sample rate of the currently bound device on which haptics is triggered and populate thedeviceSampleRatestructure. The device is determined by theXrHapticActionInfo::actionandXrHapticActionInfo::subactionPath. If thehapticActionInfois bound to more than one device, then runtime should assume that the all these bound devices have the samedeviceSampleRateand the runtime should return the sampleRate for any of those bound devices. If the device is invalid, the runtime must populate thedeviceSampleRateofXrDevicePcmSampleRateStateFBas 0. A device can be invalid if the runtime does not find any device (which can play haptics) connected to the headset, or if the device does not support PCM haptic effect.Valid Usage (Implicit)
- The
XR_FB_haptic_pcmextension must be enabled prior to callingGetDeviceSampleRateFB sessionmust be a validXrSessionhandlehapticActionInfomust be a pointer to a validXrHapticActionInfostructuredeviceSampleRatemust be a pointer to anXrDevicePcmSampleRateGetInfoFBstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
XrDevicePcmSampleRateGetInfoFB,XrDevicePcmSampleRateStateFB,XrHapticActionInfo- Parameters:
session- the specifiedXrSession.hapticActionInfo- theXrHapticActionInfoused to provide action and subaction pathsdeviceSampleRate- a pointer toXrDevicePcmSampleRateStateFBwhich is populated by the runtime.
- The
-