Hardware Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IAudioEndpointVolume::GetMasterVolumeLevelScalar method

The GetMasterVolumeLevelScalar method gets the master volume level of the audio stream that enters or leaves the audio endpoint device. The volume level is expressed as a normalized, audio-tapered value in the range from 0.0 to 1.0.

Syntax


HRESULT GetMasterVolumeLevelScalar(
  [out] float *pfLevel
);

Parameters

pfLevel [out]

Pointer to the master volume level. This parameter points to a float variable into which the method writes the volume level. The level is expressed as a normalized value in the range from 0.0 to 1.0.

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 codeDescription
E_POINTER

Parameter pfLevel is NULL.

 

Remarks

The volume level is normalized to the range from 0.0 to 1.0, where 0.0 is the minimum volume level and 1.0 is the maximum level. Within this range, the relationship of the normalized volume level to the attenuation of signal amplitude is described by a nonlinear, audio-tapered curve. Note that the shape of the curve might change in future versions of Windows. For more information about audio-tapered curves, see Audio-Tapered Volume Controls.

The normalized volume levels that are retrieved by this method are suitable to represent the positions of volume controls in application windows and on-screen displays.

For a code example that calls GetMasterVolumeLevelScalar, see Endpoint Volume Controls.

Requirements

Minimum supported client

Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Endpointvolume.h

See also

IAudioEndpointVolume Interface

 

 

Community Additions

Show:
© 2015 Microsoft