ISpatialAudioMetadataItemsBuffer::AttachToPopulatedBuffer method (spatialaudiometadata.h)

Attaches a previously populated buffer for storage of ISpatialAudioMetadataItems objects. The metadata items already in the buffer are retained.

Syntax

HRESULT AttachToPopulatedBuffer(
  [in] BYTE   *buffer,
       UINT32 bufferLength
);

Parameters

[in] buffer

A pointer to memory to use for storage.

bufferLength

The length of the supplied buffer. This size must match the length required for the metadata format and maximum metadata item count.

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
SPTLAUD_MD_CLNT_E_NO_ITEMS_OPEN
The ISpatialAudioMetadataItems has not been opened for copying with a call to Open or the object has been closed for writing with a call to Close.
SPTLAUD_MD_CLNT_E_BUFFER_ALREADY_ATTACHED
The supplied buffer has already been attached.
SPTLAUD_MD_CLNT_E_ATTACH_FAILED_INTERNAL_BUFFER
The ISpatialAudioMetadataItems was created to use a media pipeline internal buffer, so an external buffer can't be attached.
SPTLAUD_MD_CLNT_E_FORMAT_MISMATCH
The supplied populated buffer uses a format that is different from the current format.
E_INVALIDARG
One of the provided pointers is not valid.

The supplied buffer is not large enough to hold the maximum number of metadata items. Call GetSpatialAudioMetadataItemsBufferLength to determine the required buffer size.

Requirements

Requirement Value
Target Platform Windows
Header spatialaudiometadata.h

See also

ISpatialAudioMetadataItemsBuffer