C Specification

// Provided by XR_BD_spatial_audio_rendering
typedef struct XrAudioBufferBD {
    XrStructureType                 type;
    const void*                     next;
    XrAudioBufferChannelLayoutBD    channelLayout;
    uint32_t                        bufferChannels;
    uint32_t                        bufferLength;
    float*                          buffer;
} XrAudioBufferBD;

Members

Parameter Descriptions
  • type is the XrStructureType of this structure.

  • next is NULL or a pointer to the next structure in a structure chain.

  • channelLayout is the XrAudioBufferChannelLayoutBD that specifies the memory layout of the audio data (for example interleaved or planar).

  • bufferChannels is the number of channels in the audio buffer.

  • bufferLength is the number of floating-point elements in buffer. It must be equal to the product of bufferChannels and the XrSpatialAudioRendererCreateInfoBD::framesPerBuffer used when creating the spatial audio renderer.

  • buffer is a pointer to a floating-point array containing the audio data.

Description

The audio data in buffer is stored in little-endian byte order.

bufferLength and bufferChannels must be compatible with the values specified in XrSpatialAudioRendererCreateInfoBD when creating the renderer. In particular, the application must set bufferLength to bufferChannels * XrSpatialAudioRendererCreateInfoBD::framesPerBuffer, otherwise the runtime must return XR_ERROR_VALIDATION_FAILURE.

The application must ensure that the audio signal stored in this XrAudioBufferBD is sampled at a sample rate of XrSpatialAudioRendererCreateInfoBD::sampleRate. Supplying data from a mismatched sample rate results in unspecified behavior, commonly perceived as tempo/pitch shifts and spectral coloration.

Valid Usage (Implicit)

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.