KSPROPERTY_AUDIO_PEAKMETER2
Windows 8 introduced the KSPROPERTY_AUDIO_PEAKMETER2 property that reports the maximum audio signal level that occurred at a peakmeter node (KSNODETYPE_PEAKMETER) since the last time the peakmeter node was reset.
Usage Summary Table
Get | Set | Target | Property descriptor type | Property value type |
---|---|---|---|---|
Yes |
No |
Node via Filter or Pin instance |
KSNODEPROPERTY_AUDIO_CHANNEL | LONG |
The property value (operation data) is of type LONG and specifies the peak sample value at the node. If the peak value is negative, its absolute value is used.
Return Value
A KSPROPERTY_AUDIO_PEAKMETER2 property request returns STATUS_SUCCESS to indicate that it has completed successfully. Otherwise, the request returns an appropriate error status code. The following table shows a possible error status code.
Status Code | Meaning |
---|---|
STATUS_NOT_IMPLEMENTED |
The KS filter cannot return the current value of the peakmeter. |
Remarks
The KSPROPERTY_AUDIO_PEAKMETER2 property is almost identical to the KSPROPERTY_AUDIO_PEAKMETER property. The KSPROPERTY_AUDIO_PEAKMETER2 property was introduced with Windows 8 to provide improved hardware metering of a pin topology. The legacy KSPROPERTY_AUDIO_PEAKMETER property is deprecated and should no longer be used.
SignedMinimum must be set to LONG_MIN (instead of 0x8000), and SignedMaximum must be set to LONG_MAX (instead of 0x7fff). And also, note that peak meter values are relative to this scale and the scale is linear in amplitude.
So if, for example, you have a waveform with negative and positive peaks at -1 and +1 respectively (on a scale that goes from -1 to +1), then a peak meter value of LONG_MAX accurately reports the maximum waveform value for a given time window. Conversely, a peak meter value of zero (0) should be used to report silence, where all the waveform’s values are zero. But in the case of a waveform whose peak values are between zero (0) and LONG_MAX, the reported waveform values would be linearly reduced from the originals.
Therefore, in the case of the waveform that swings between -0.5 and +0.5 (on a scale that goes from -1 to +1), the peak meter value must be set to LONG_MAX/2.
A KS audio filter handles this property request synchronously. If the request succeeds, it resets the peakmeter, which initializes the accumulated peak value to zero. If the request does not succeed, the peakmeter is not changed.
The system sends an IOCTL_KS_PROPERTY request for the KSPROPERTY_AUDIO_PEAKMETER2 property at IRQL PASSIVE_LEVEL.
Requirements
Header |
Ksmedia.h (include Ksmedia.h) |