ISpatialAudioMetadataReader::ReadNextItem method (spatialaudiometadata.h)

Gets the number of commands and the sample offset for the metadata item being read.

Syntax

HRESULT ReadNextItem(
  [out] UINT8  *commandCount,
  [out] UINT16 *frameOffset
);

Parameters

[out] commandCount

Receives the number of command/value pairs in the metadata item being read.

[out] frameOffset

Gets the frame offset associated with the metadata item being read.

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 reading with a call to Open or the object has been closed for writing with a call to Close.
SPTLAUD_MD_CLNT_E_NO_MORE_ITEMS
There are no more metadata items in the frame range specified in the call to ReadItemCountInFrames.
E_INVALIDARG
One of the provided pointers is not valid.

Remarks

Before calling ReadNextItem, you must open the ISpatialAudioMetadataReader for reading by calling Open after the object is created and after Close has been called. You must also call ReadItemCountInFrames before calling ReadNextItem.

The ISpatialAudioMetadataReader keeps an internal pointer to the current position within the total range of frames contained by the ISpatialAudioMetadataItems with which the reader is associated. Each call to this method causes the pointer to be advanced by the number of frames specified in the readFrameCount parameter.

The process for reading commands and the associated values is recursive. After each call to ReadItemCountInFrames, call ReadNextItem to get the number of commands in the next item. After every call to ReadNextItem, call ReadNextItemCommand to read each command for the item. Repeat this process until the entire frame range of the ISpatialAudioMetadataItems has been read.

Requirements

Requirement Value
Target Platform Windows
Header spatialaudiometadata.h

See also

ISpatialAudioMetadataReader