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

◆ ensurePeaks()

void fl::AudioBatch::ensurePeaks ( ) const
private

Definition at line 6 of file audio_batch.cpp.hpp.

6 {
7 fl::lock_guard<fl::mutex> lock(mMutex);
8 if (mPeaksComputed) {
9 return;
10 }
11 for (const AudioFrame &af : mFrames) {
12 if (af.bass > mPeaks.bass)
13 mPeaks.bass = af.bass;
14 if (af.mid > mPeaks.mid)
15 mPeaks.mid = af.mid;
16 if (af.treble > mPeaks.treble)
17 mPeaks.treble = af.treble;
18 if (af.volume > mPeaks.volume)
19 mPeaks.volume = af.volume;
20 mPeaks.beat = mPeaks.beat || af.beat;
21 }
22 mPeaksComputed = true;
23}
fl::span< const AudioFrame > mFrames
Definition audio_batch.h:99
AudioFrame mPeaks
fl::mutex mMutex

References mFrames, mMutex, mPeaks, and mPeaksComputed.

Referenced by bass(), beat(), mid(), treble(), and volume().

+ Here is the caller graph for this function: