Detects an audio signal's volume. More...
Import Statement: | import |
Inherits: |
Detects the volume of an MP3Decoder's audio signal. It does so by using a PeakFinder on the absolute value on the filtered signal.
This is a subclass of DirectForm2Filter, but the filtering is performed on the signal's absolute value. For volume detection it is advisible to set the DirectForm2Filter::data property to a smoothing, e.g. low-pass filter.
The current volume can be read from volume.
Set this to an estimate of the DirectForm2Filter's delay time, in milliseconds. The volume will then be calculated and set that much time in advance.
The current detected volume, a real
value between 0
and 1
. Realistically usually below 0.5
, but this depends on the signal and the DirectForm2Filter::data setting.