ISpatialAudioClient2::GetMaxFrameCountForCategory method (spatialaudioclient.h)

Gets the maximum supported frame count per processing pass.

Syntax

HRESULT GetMaxFrameCountForCategory(
  [in]  AUDIO_STREAM_CATEGORY category,
  [in]  BOOL                  offloadEnabled,
  [in]  const WAVEFORMATEX    *objectFormat,
  [out] UINT32                *frameCountPerBuffer
);

Parameters

[in] category

The AUDIO_STREAM_CATEGORY (audiosessiontypes.h) of the audio stream for which support is queried.

[in] offloadEnabled

A boolean value specifying whether the returned frame count should be calculated with audio offload support considered. If this flag is set to true, the returned frame count is what it would be if the stream is activated for offload mode. However, if this flag is set to true but the audio endpoint does not support offload mode, then the flag has no effect. Use ISpatialAudioClient2::IsOffloadCapable to check if offload mode is supported.

[in] objectFormat

A pointer to a WAVEFORMATEX (mmeapi.h) structure specifying the format of the audio stream for which support is queried.

[out] frameCountPerBuffer

Receives a pointer to an INT32 indicating the maximum supported frame count for the audio device and the specified input parameters.

Return value

An HRESULT including the following values.

Value Description
S_OK Success
AUDCLNT_E_DEVICE_INVALIDATED The audio device associated with the audio client has been invalidated.

Remarks

The value returned by this method can be used to allocate source buffer. This value will change if the endpoint cadence changes. The caller must specify same AUDIO_STREAM_CATEGORY and WAVEFORMATEX values that will be used when creating the stream. The offloadEnabled parameter must be set to TRUE if the stream will be created with the SPATIAL_AUDIO_STREAM_OPTIONS_OFFLOAD flag.

Requirements

Requirement Value
Minimum supported client Windows Build 22000
Header spatialaudioclient.h