C Specification

The xrWaitAudioPeriodBD function is defined as:

// Provided by XR_BD_spatial_audio_rendering
XrResult xrWaitAudioPeriodBD(
    XrSpatialAudioRendererBD                    renderer,
    XrDuration                                  timeout);

Parameters

Parameter Descriptions
  • renderer is the XrSpatialAudioRendererBD which notifies the beginning of the next audio period.

  • timeout is an XrDuration that specifies the maximum duration to wait for the next audio period in nanoseconds.

Description

This function blocks the calling thread until the next audio period begins or the specified timeout expires.

The runtime must only unblock the calling thread after the previously submitted audio buffers are processed and before the previous output audio is done playing, so that output audio is gapless.

The runtime should unblock the calling thread as soon as possible after the above criteria is met.

If a previous call to xrEndAudioPeriodBD has not been successful, this function must return XR_ERROR_CALL_ORDER_INVALID.

timeout must be greater than zero, otherwise the runtime must return XR_ERROR_VALIDATION_FAILURE.

This function must return XR_TIMEOUT_EXPIRED if the specified timeout expires before the next audio period begins.

Calling this function must be externally synchronized by the application, concurrent calls may result in undefined behavior.

Valid Usage (Implicit)
Thread Safety
Return Codes
On success, this command returns
  • XR_SUCCESS

  • XR_SESSION_LOSS_PENDING

  • XR_TIMEOUT_EXPIRED

On failure, this command returns
  • XR_ERROR_CALL_ORDER_INVALID

  • XR_ERROR_FUNCTION_UNSUPPORTED

  • XR_ERROR_HANDLE_INVALID

  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_SESSION_LOST

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 2014-2026 The Khronos Group Inc.