FastLED 3.9.15
Loading...
Searching...
No Matches

◆ checkSilenceCondition()

bool fl::audio::detector::Silence::checkSilenceCondition ( float smoothedRMS)
private

Definition at line 128 of file silence.cpp.hpp.

128 {
129 // Use hysteresis to prevent rapid toggling
130 // When currently silent, use a higher threshold to exit
131 // When not silent, use a lower threshold to enter
132 if (mPreviousSilent) {
133 // Currently in potential silence - need louder signal to exit
134 float exitThreshold = mSilenceThreshold * (1.0f + mHysteresis);
135 return smoothedRMS <= exitThreshold;
136 } else {
137 // Currently not silent - need quiet signal to enter
138 float enterThreshold = mSilenceThreshold * (1.0f - mHysteresis);
139 return smoothedRMS <= enterThreshold;
140 }
141}

References mHysteresis, mPreviousSilent, and mSilenceThreshold.

Referenced by update().

+ Here is the caller graph for this function: