IAudioMeterInformation::GetChannelsPeakValues method (endpointvolume.h)

The GetChannelsPeakValues method gets the peak sample values for all the channels in the audio stream.

Syntax

HRESULT GetChannelsPeakValues(
  [in]  UINT32 u32ChannelCount,
  [out] float  *afPeakValues
);

Parameters

[in] u32ChannelCount

The channel count. This parameter also specifies the number of elements in the afPeakValues array. If the specified count does not match the number of channels in the stream, the method returns error code E_INVALIDARG.

[out] afPeakValues

Pointer to an array of peak sample values. The method writes the peak values for the channels into the array. The array contains one element for each channel in the stream. The peak values are numbers 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_INVALIDARG
Parameter u32ChannelCount does not equal the number of channels in the audio stream.
E_POINTER
Parameter afPeakValues is NULL.

Remarks

This method retrieves the peak sample values for 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 values recorded during the previous device period. To obtain the device period, call the IAudioClient::GetDevicePeriod method.

Parameter afPeakValues points to a caller-allocated float array. If the stream contains n channels, the channels are numbered 0 to n– 1. The method stores the peak value for each channel in the array element whose array index matches the channel number. To get the number of channels in the audio stream that are monitored by peak meters, call the IAudioMeterInformation::GetMeteringChannelCount method.

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

IAudioMeterInformation::GetMeteringChannelCount