EnableSpatialAudio

This function allows titles to access Windows Sonic by enabling spatial audio clients.

Syntax

HRESULT EnableSpatialAudio()  

Return value

Type: HRESULT 

Remarks

EnableSpatialAudio must be called before enumerating any audio endpoint. If this function is called after any device enumeration happens (e.g. CDeviceEnumerator::EnumAudioEndpoints() or CDeviceEnumerator::GetDefaultAudioEndpoint()), the call will fail with E_UNEXPECTED.

Note Please be aware that many third-party plugins will enumerate devices.

After spatial audio is enabled, you will be able to activate ISpatialAudioClients on MMDevices. Attempting to activate them without calling EnableSpatialAudio will result in E_NOINTERFACE. You will be able to activate IAudioClients as normal.

You should avoid calling EnableSpatialAudio if you do not plan on using ISpatialAudioClients.

This function may be called from any thread, and multiple calls will succeed.

For more information about spatial audio, see the Windows Sonic Overview.

Requirements

Header: Declared in mmdeviceapi.h.

Library: Use MMDevApi.lib.