ISpatialAudioObjectBase::SetEndOfStream method (spatialaudioclient.h)

Instructs the system that the final block of audio data has been submitted for the ISpatialAudioObject so that the object can be deactivated and its resources reused.


HRESULT SetEndOfStream(
  [in] UINT32 frameCount


[in] frameCount

The number of audio frames in the audio buffer that should be included in the final processing pass. This number may be smaller than or equal to the value returned in the frameCountPerBuffer parameter to ISpatialAudioObjectRenderStream::BeginUpdatingAudioObjects.

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

ISpatialAudioObjectRenderStream::BeginUpdatingAudioObjects was not called before the call to SetEndOfStream.


SetEndOfStream was called either explicitly or implicitly in a previous audio processing pass. SetEndOfStream is called implicitly by the system if GetBuffer is not called within an audio processing pass (between calls to ISpatialAudioObjectRenderStream::BeginUpdatingAudioObjects and ISpatialAudioObjectRenderStream::EndUpdatingAudioObjects).


Call Release after calling SetEndOfStream to make free the audio object resources for future use.


Target Platform Windows
Header spatialaudioclient.h

See also