C Specification
The XrHapticPcmVibrationFB structure is defined as:
// Provided by XR_FB_haptic_pcm
typedef struct XrHapticPcmVibrationFB {
XrStructureType type;
const void* next;
uint32_t bufferSize;
const float* buffer;
float sampleRate;
XrBool32 append;
uint32_t* samplesConsumed;
} XrHapticPcmVibrationFB;
Members
Description
This structure describes a PCM haptic effect.
The runtime may resample the provided samples in the buffer
, and
maintain an internal buffer which should be of
XR_MAX_HAPTIC_PCM_BUFFER_SIZE_FB length.
The resampling should happen based on the sampleRate
and the device’s
sample rate.
If append
is XR_TRUE
and a preceding
XrHapticPcmVibrationFB haptic effect on this action has not yet
completed, then the runtime must finish playing the preceding samples and
then play the new haptic effect.
If a preceding haptic event on this action has not yet completed, and either
the preceding effect is not an XrHapticPcmVibrationFB haptic effect or
append
is XR_FALSE
, the runtime must cancel the preceding
incomplete effects on that action and start playing the new haptic effect,
as usual for the core specification.
When append
is true and a preceding XrHapticPcmVibrationFB
haptic effect on this action has not yet completed, then the application can
provide a different sampleRate
in the new haptic effect.
The runtime must populate the samplesConsumed
with the count of the
samples from buffer
which were consumed.
The samplesConsumed
is populated before the
xrApplyHapticFeedback returns.
See Also
Document Notes
For more information, see the OpenXR Specification
This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright 2014-2024, The Khronos Group Inc.
This work is licensed under a Creative Commons Attribution 4.0 International License.