ISpatialAudioClient interface

The ISpatialAudioClient interface enables a client to create audio streams that emit audio from a position in 3D space. This interface is a part of Windows Sonic, Microsoft’s audio platform for more immersive audio which includes integrated spatial sound on Xbox and Windows.

Methods

The ISpatialAudioClient interface has these methods.

Method Description
ISpatialAudioClient::ActivateSpatialAudioStream Activates and initializes spatial audio stream using one of the spatial audio stream activation structures.
ISpatialAudioClient::GetMaxDynamicObjectCount Gets the maximum number of dynamic audio objects for the spatial audio client.
ISpatialAudioClient::GetMaxFrameCount Gets the maximum possible frame count per processing pass. This method can be used to determine the size of the source buffer that should be allocated to convey audio data for each processing pass.
ISpatialAudioClient::GetNativeStaticObjectTypeMask Gets a channel mask which represents the subset of static speaker bed channels native to current rendering engine.
ISpatialAudioClient::GetStaticObjectPosition Gets the position in 3D space of the specified static spatial audio channel.
ISpatialAudioClient::GetSupportedAudioObjectFormatEnumerator Gets an IAudioFormatEnumerator that contains all supported audio formats for spatial audio objects, the first item in the list represents the most preferable format.
ISpatialAudioClient::IsAudioObjectFormatSupported Gets a value indicating whether ISpatialAudioObjectRenderStream supports a the specified format.
ISpatialAudioClient::IsSpatialAudioStreamAvailable When successful, gets a value indicating whether the currently active spatial rendering engine supports the specified spatial audio render stream.

Remarks

Get an instance of this interface by calling ActivateAudioInterfaceAsync, using the __uuidof operator to get the class ID of the ISpatialAudioClient interface. The following example code shows how to initialize this interface.

PROPVARIANT var; 
PropVariantInit(&var);  
auto p = reinterpret_cast<SpatialAudioClientActivationParams *>(CoTaskMemAlloc(sizeof(SpatialAudioClientActivationParams)));  
if (nullptr == p) { ... } 
p->tracingContextId = /* context identifier */;  
p->appId = /* app identifier */;  
p->majorVersion = /* app version info */;  
p->majorVersionN = /* app version info */;
var.vt = VT_BLOB;
var.blob.cbSize = sizeof(*p);
var.blob.pBlobData = reinterpret_cast<BYTE *>(p); 
hr = ActivateAudioInterfaceAsync(device, __uuidof(ISpatialAudioClient), &var, ...);
// ...
ropVariantClear(&var);
Note  When using the ISpatialAudioClient interfaces on an Xbox One Development Kit (XDK) title, you must first call EnableSpatialAudio before calling IMMDeviceEnumerator::EnumAudioEndpoints or IMMDeviceEnumerator::GetDefaultAudioEndpoint. Failure to do so will result in an E_NOINTERFACE error being returned from the call to Activate. EnableSpatialAudio is only available for XDK titles, and does not need to be called for Universal Windows Platform apps running on Xbox One, nor for any non-Xbox One devices.
 
To access the ActivateAudioIntefaceAsync, you will need to link to mmdevapi.lib.

Requirements

   
Minimum supported client Windows 10, version 1703 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header spatialaudioclient.h