IAudioClient2::GetBufferSizeLimits Method

The GetBufferSizeLimits method returns the buffer size limits of the hardware audio engine in 100-nanosecond units.

Syntax

public:
HRESULT GetBufferSizeLimits(
         const WAVEFORMATEX *pFormat,
         BOOL bEventDriven,
         REFERENCE_TIME *phnsMinBufferDuration,
         REFERENCE_TIME *phnsMaxBufferDuration
)  

Parameters

pFormat
Type: WAVEFORMATEX *

[in] A pointer to the target format that is being queried for the buffer size limit.

bEventDriven
Type: BOOL 

[in] Boolean value to indicate whether or not the stream can be event-driven.

phnsMinBufferDuration
Type: REFERENCE_TIME *

[out] Returns a pointer to the minimum buffer size (in 100-nanosecond units) that is required for the underlying hardware audio engine to operate at the format specified in the pFormat parameter, without frequent audio glitching.

phnsMaxBufferDuration
Type: REFERENCE_TIME *

[out] Returns a pointer to the maximum buffer size (in 100-nanosecond units) that the underlying hardware audio engine can support for the format specified in the pFormat parameter.

Return value

Type: HRESULT 

The GetBufferSizeLimits method returns S_OK to indicate that it has completed successfully. Otherwise it returns an appropriate error code. For example, it can return AUDCLNT_E_DEVICEINVALIDATED, if the device was removed and the method is called. It can also return AUDCLNT_E_OFFLOAD_MODE_ONLY because hardware offload is not supported in the Game OS.

Refer to WASAPI error codes.

Remarks

The GetBufferSizeLimits method is a device-facing method and does not require prior audio stream initialization.

Requirements

Header: Declared in audioclient.h.

Library: Use mmdevapi.lib.

See also

IAudioClient2

IAudioClient2 Members