Implements fl::audio::Detector.
Definition at line 23 of file energy_analyzer.cpp.hpp.
23 {
24
26 u32 timestamp = context->getTimestamp();
27
28
30
31
33
34
38 }
39
40
41
42 const float dt =
computeAudioDt(context->getPCM().size(), context->getSampleRate());
44
45 if (runningMax < 1.0f) {
46 runningMax = 1.0f;
47 }
49}
AttackDecayFilter< float > mRunningMaxFilter
void updateAverage(float energy)
void updatePeak(float energy, u32 timestamp)
float computeAudioDt(fl::size pcmSize, int sampleRate) FL_NOEXCEPT
Compute the time delta (in seconds) for an audio buffer.
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
References EnergyAnalyzer(), fl::audio::computeAudioDt(), fl::max(), mCurrentRMS, fl::min(), mMaxEnergy, mMinEnergy, mNormalizedRMS, mRunningMaxFilter, update(), updateAverage(), and updatePeak().
Referenced by ~EnergyAnalyzer(), and update().