164 {
166 return;
167 }
168
169
170 fl::u32 currentTimeMs =
sample.timestamp();
171
172
173 Sample processedSample =
sample;
174
175
176 if (
mConfig.enableSignalConditioning) {
178 if (!processedSample.isValid()) {
179 return;
180 }
181 }
182
183
184 if (
mConfig.enableNoiseFloorTracking) {
185 float rms = processedSample.rms();
187 }
188
189
190 mContext->setSample(processedSample);
191
192
193
194
195
196
197
198
199
200
201 if (
mConfig.enableNoiseFloorTracking) {
202 constexpr float kSilenceRmsThreshold = 10.0f;
203 mContext->setSilent(processedSample.rms() < kSilenceRmsThreshold);
204 }
205
206
208
209
210
213
215
216
219
220
221
223 for (int i = 0; i < 16; ++i) {
225 }
226 }
227
228
229
230
231
233
235
236
237
238
239
240
241
242
243
244 {
245 const bool silent =
mContext->isSilent();
254 }
255
256
259
260
261
263
267
269
270
271}
float rms(fl::span< const int16_t > data)
float mPinkNoiseGains[16]
void calculateBandEnergies() FL_NO_EXCEPT
void updateSpectralFlux() FL_NO_EXCEPT
void detectBeat(fl::u32 currentTimeMs) FL_NO_EXCEPT
void applyLoudnessCompensation() FL_NO_EXCEPT
void applySpectralEqualization() FL_NO_EXCEPT
SilenceEnvelope mDominantFrequencyEnvelope
shared_ptr< Context > mContext
fl::unique_ptr< Processor > mAudioProcessor
void applyAWeighting() FL_NO_EXCEPT
SilenceEnvelope mMagnitudeEnvelope
void applyGain() FL_NO_EXCEPT
void updateVolumeAndPeak(const Sample &sample) FL_NO_EXCEPT
SignalConditioner mSignalConditioner
NoiseFloorTracker mNoiseFloorTracker
void applyScaling() FL_NO_EXCEPT
void detectEnhancedBeats(fl::u32 currentTimeMs) FL_NO_EXCEPT
Processor & ensureAudioProcessor() FL_NO_EXCEPT
void smoothResults() FL_NO_EXCEPT
SilenceEnvelope mSpectralFluxEnvelope
void processFFT(const Sample &sample) FL_NO_EXCEPT
float computeAudioDt(fl::size pcmSize, int sampleRate) FL_NO_EXCEPT
Compute the time delta (in seconds) for an audio buffer.
CRGB sample(const CRGB *grid, const XYMap &xyMap, float x, float y, SampleMode mode) FL_NO_EXCEPT
Sample a pixel from a 2D CRGB grid at floating-point coordinates.