IAudioMeterInformation::GetPeakValue method (endpointvolume.h)

The GetPeakValue method gets the peak sample value for the channels in the audio stream.

Syntax

HRESULT GetPeakValue(
  [out] float *pfPeak
);

Parameters

[out] pfPeak

Pointer to a float variable into which the method writes the peak sample value for the audio stream. The peak value is a number in the normalized 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 code Description
E_POINTER
Parameter pfPeak is NULL.

Remarks

This method retrieves the peak sample value recorded across all of the channels in the stream. The peak value for each channel is recorded over one device period and made available during the subsequent device period. Thus, this method always retrieves the peak value recorded during the previous device period. To obtain the device period, call the IAudioClient::GetDevicePeriod method.

For a code example that uses the GetPeakValue method, see Peak Meters.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header endpointvolume.h

See also

IAudioClient::GetDevicePeriod

IAudioMeterInformation Interface