IPerChannelDbLevel::GetLevelRange method (devicetopology.h)

The GetLevelRange method gets the range, in decibels, of the volume level of the specified channel.

Syntax

HRESULT GetLevelRange(
  [in]  UINT  nChannel,
  [out] float *pfMinLevelDB,
  [out] float *pfMaxLevelDB,
  [out] float *pfStepping
);

Parameters

[in] nChannel

The number of the selected channel. If the audio stream has n channels, the channels are numbered from 0 to n– 1. To get the number of channels in the stream, call the IPerChannelDbLevel::GetChannelCount method.

[out] pfMinLevelDB

Pointer to a float variable into which the method writes the minimum volume level in decibels.

[out] pfMaxLevelDB

Pointer to a float variable into which the method writes the maximum volume level in decibels.

[out] pfStepping

Pointer to a float variable into which the method writes the stepping value between consecutive volume levels in the range *pfMinLevelDB to *pfMaxLevelDB. If the difference between the maximum and minimum volume levels is d decibels, and the range is divided into n steps (uniformly sized intervals), then the volume can have n + 1 discrete levels and the size of the step between consecutive levels is d / n decibels.

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
E_INVALIDARG
Parameter nChannel is out of range.
E_POINTER
Pointer pfminLevelDB, pfmaxLevelDB, or pfmaxLevelDB is NULL.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header devicetopology.h

See also

IPerChannelDbLevel Interface

IPerChannelDbLevel::GetChannelCount