Share via


ISpatialAudioMetadataReader::ReadItemCountinFrames method

Specifies the range, in frames, from which the caller wishes to extract metadata items from the ISpatialAudioMetadataItems object. This method returns the number of metadata items present in the specified range of frames. Each call advances the internal copy position by the number of frames in the readFrameCount parameter.

Syntax

HRESULT ReadItemCountinFrames(
  [in]  UINT16 readFrameCount,
  [out] UINT16 *itemCount
);

Parameters

  • readFrameCount [in]
    The number of frames of the subrange from which metadata items will be read. If this value is 0, the full frame range of the ISpatialAudioMetadataItems is read.

  • itemCount [out]
    The number of metadata commands within the range specified by readFrameCount.

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.

E_INVALIDARG

One of the provided pointers is not valid.

 

Remarks

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

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

Header

SpatialAudioMetadata.h

See also

ISpatialAudioMetadataReader