ISpatialAudioObjectRenderStream::ActivateSpatialAudioObject method (spatialaudioclient.h)

Activates an ISpatialAudioObject for audio rendering.

Syntax

HRESULT ActivateSpatialAudioObject(
  [in]  AudioObjectType     type,
  [out] ISpatialAudioObject **audioObject
);

Parameters

[in] type

The type of audio object to activate. For dynamic audio objects, this value must be AudioObjectType_Dynamic. For static audio objects, specify one of the static audio channel values from the enumeration. Specifying AudioObjectType_None will produce an audio object that is not spatialized.

[out] audioObject

Receives a pointer to the activated interface.

Return value

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
SPTLAUDCLNT_E_NO_MORE_OBJECTS
The system has reached the maximum number of simultaneous audio objects.
SPTLAUDCLNT_E_DESTROYED
The ISpatialAudioClient associated with the spatial audio stream has been destroyed.
AUDCLNT_E_DEVICE_INVALIDATED
The audio endpoint device has been unplugged, or the audio hardware or associated hardware resources have been reconfigured, disabled, removed, or otherwise made unavailable for use.
SPTLAUDCLNT_E_INTERNAL
An internal error has occurred.
AUDCLNT_E_UNSUPPORTED_FORMAT
The media associated with the spatial audio stream uses an unsupported format.

Remarks

A dynamic ISpatialAudioObject is one that was activated by setting the type parameter to the ActivateSpatialAudioObject method to AudioObjectType_Dynamic. The client has a limit of the maximum number of dynamic spatial audio objects that can be activated at one time. After the limit has been reached, attempting to activate additional audio objects will result in this method returning an SPTLAUDCLNT_E_NO_MORE_OBJECTS error. To avoid this, call Release on each dynamic ISpatialAudioObject after it is no longer being used to free up the resource so that it can be reallocated. See ISpatialAudioObject::IsActive and ISpatialAudioObject::SetEndOfStream for more information on the managing the lifetime of spatial audio objects.

Requirements

Requirement Value
Target Platform Windows
Header spatialaudioclient.h

See also

ISpatialAudioObjectRenderStream