ISpatialAudioObjectForMetadataItems::GetBuffer method

Gets a buffer that is used to supply the audio data for the ISpatialAudioObjectForMetadataItems.

Syntax

HRESULT GetBuffer(
  [out] BYTE   **buffer,
  [out] UINT32 *bufferLength
);

Parameters

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_OUT_OF_ORDER

ISpatialAudioObjectRenderStreamForMetadata::BeginUpdatingAudioObjects was not called before the call to GetBuffer. This method must be called before the first time GetBuffer is called and after every subsequent call to ISpatialAudioObjectRenderStreamForMetadata::EndUpdatingAudioObjects .

SPTLAUDCLNT_E_RESOURCES_INVALIDATED

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 ISpatialAudioObjectRenderStreamForMetadata::BeginUpdatingAudioObjects and ISpatialAudioObjectRenderStreamForMetadata::EndUpdatingAudioObjects).

 

Remarks

The first time GetBuffer is called after the ISpatialAudioObjectForMetadataItems is activated with a call ISpatialAudioObjectRenderStreamForMetadataItems::ActivateSpatialAudioObjectForMetadataItems, lifetime of the spatial audio object starts. To keep the spatial audio object alive after that, this GetBuffer must be called on every processing pass (between calls to ISpatialAudioObjectRenderStreamForMetadata::BeginUpdatingAudioObjects and ISpatialAudioObjectRenderStreamForMetadata::EndUpdatingAudioObjects). If GetBuffer is not called within an audio processing pass, SetEndOfStream is called implicitly on the audio object to deactivate, and the audio object can only be reused after calling Release on the object and then reactivating the object by calling ActivateSpatialAudioObjectForMetadataItems again.

The pointers retrieved by GetBuffer should not be used after ISpatialAudioObjectRenderStreamForMetadata::EndUpdatingAudioObjects has been called.

Requirements

Header

Spatialaudioclient.h

See also

ISpatialAudioObjectForMetadataItems