C Specification

The xrEnumerateSupportedAudioSampleRateBD function is defined as:

// Provided by XR_BD_spatial_audio_rendering
XrResult xrEnumerateSupportedAudioSampleRateBD(
    XrSession                                   session,
    uint32_t                                    sampleRateCapacityInput,
    uint32_t*                                   sampleRateCountOutput,
    XrAudioSampleRateBD*                        sampleRates);

Parameters

Parameter Descriptions
  • session is the XrSession for which to enumerate supported audio sample rates.

  • sampleRateCapacityInput is the capacity of the sampleRates array, or 0 to indicate a request to retrieve the required capacity.

  • sampleRateCountOutput is a pointer to the count of sampleRates written, or a pointer to the required capacity in the case that sampleRateCapacityInput is insufficient.

  • sampleRates is a pointer to an array of XrAudioSampleRateBD structures, but can be NULL if sampleRateCapacityInput is 0.

  • See the https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#fundamentals-buffer-size-parameters section for a detailed description of retrieving the required sampleRates size.

Description

Before creating the XrSpatialAudioRendererBD, applications should call xrEnumerateSupportedAudioSampleRateBD to enumerate supported audio sample rates. Applications must set XrSpatialAudioRendererCreateInfoBD::sampleRate to one of the supported sample rates, otherwise the runtime must return XR_ERROR_VALIDATION_FAILURE from xrCreateSpatialAudioRendererBD.

The values enumerated by this function must not change during the lifetime of an XrInstance.

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

  • XR_SESSION_LOSS_PENDING

On failure, this command returns
  • XR_ERROR_FUNCTION_UNSUPPORTED

  • XR_ERROR_HANDLE_INVALID

  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_SESSION_LOST

  • XR_ERROR_VALIDATION_FAILURE

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.