VolumeSmoother class
A class that smooths volume values over time using a configurable smoothing factor.
This class maintains a history of volume values and applies exponential moving average smoothing to reduce noise and sudden changes in volume readings.
Constructors
- VolumeSmoother.new({double smoothingFactor = 0.3, int maxHistorySize = 100})
- Creates a VolumeSmoother with the specified smoothing factor.
Properties
- averageVolume → double
-
Gets the average volume from the current history.
no setter
- currentVolume → double
-
Gets the current smoothed volume value.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- historySize → int
-
Gets the number of volume values in history.
no setter
- minimumVolume → double
-
Gets the minimum volume from the current history.
no setter
- peakVolume → double
-
Gets the peak (maximum) volume from the current history.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- smoothingFactor → double
-
The smoothing factor (0.0 to 1.0).
final
- statistics → VolumeStatistics
-
Gets statistics about the volume history.
no setter
-
volumeHistory
→ List<
double> -
Gets a copy of the volume history as a list.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Resets the smoother to its initial state.
-
smooth(
double rawVolume) → double - Processes a raw volume value and returns the smoothed result.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited