The GetVolumeRange method gets the volume range, in decibels, of the audio stream that enters or leaves the audio endpoint device.
public:
HRESULT GetVolumeRange(
float *pfLevelMinDB,
float *pfLevelMaxDB,
float *pfVolumeIncrementDB
)
pfLevelMinDB
Type: float *
[out] Pointer to the minimum volume level. This parameter points to a float variable into which the method writes the minimum volume level in decibels. This value remains constant for the lifetime of the IAudioEndpointVolume Interface instance.
pfLevelMaxDB
Type: float *
[out] Pointer to the maximum volume level. This parameter points to a float variable into which the method writes the maximum volume level in decibels. This value remains constant for the lifetime of the IAudioEndpointVolume Interface instance.
pfVolumeIncrementDB
Type: float *
[out] Pointer to the volume increment. This parameter points to a float variable into which the method writes the volume increment in decibels. This increment remains constant for the lifetime of the IAudioEndpointVolume Interface instance.
Type: HRESULT
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_POINTER | Parameter pfLevelMinDB, pfLevelMaxDB, or pfVolumeIncrementDB is NULL. |
The volume range from vmin = *pfLevelMinDB to vmax = *pfLevelMaxDB is divided into n uniform intervals of size vinc = *pfVolumeIncrementDB, where:
n = (vmax – vmin) / vinc
The values vmin, vmax, and vinc are measured in decibels. The client can set the volume level to one of n + 1 discrete values in the range from vmin to vmax.
Header: Declared in endpointvolume.h.
Library: Use MMDevApi.lib.