KSNODETYPE_PEAKMETER
The KSNODETYPE_PEAKMETER node represents a hardware peakmeter. A KS peakmeter node has one input pin and one output pin, and the two pins share the same data format.
A KS peakmeter internally logs the maximum value of the audio signal since the last time the peakmeter was reset to zero. The peakmeter automatically resets itself to zero after an IOCTL_KS_PROPERTY request to get a KSPROPERTY_AUDIO_PEAKMETER2 property.
A peakmeter requires hardware support. A software peakmeter is not feasible, and this is because the adapter driver does not have access to signals that are present on line-in, microphone, or other inputs that are mixed with the playback channel.
Microsoft recommends making a peakmeter node the final node through which a stream passes within a filter. On a render stream, an audio adapter usually connects a peakmeter node after a master output KSNODETYPE_MUTE node or a KSNODETYPE_VOLUME node. The same approach applies to a capture stream or any other streams for which the filter incorporates a peakmeter node.
An audio adapter should name a peakmeter node KSAUDFNAME_PEAKMETER.
A peakmeter node should provide a property handler for the property flags (see KSPROPERTY) that appear in the following table.
Flag Name | Meaning |
---|---|
KSPROPERTY_TYPE_GET |
Returns the current value of the hardware peakmeter. |
KSPROPERTY_TYPE_BASICSUPPORT |
For KSPROPERTY_AUDIO_PEAKMETER - Returns a data range of 0x8000 to 0x7fff, which is the data range of 16-bit digital audio. The upper 16 bits must be set to zero, to allow the operating system to receive a positive value. Note that KSPROPERTY_AUDIO_PEAKMETER is deprecated and KSPROPERTY_AUDIO_PEAKMETER2 should be used instead. For KSPROPERTY_AUDIO_PEAKMETER2 - Returns a data range of LONG_MIN to LONG_MAX. |
The property handler should verify input parameters and left and right channel information.
A peakmeter node should also support the properties in the following table.
Property Name | Description |
---|---|
Represents the peakmeter control. |
|
Indicates whether the specified node's functionality makes use of the host CPU. |