FastLED 3.10.8
Loading...
Searching...
No Matches

◆ ensurePeaks()

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

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

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

References fl::FL_NO_EXCEPT, mFrames, mMutex, mPeaks, and mPeaksComputed.

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

+ Here is the caller graph for this function: