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)
void updateSpectralFlux()
void detectEnhancedBeats(fl::u32 currentTimeMs)
float mPinkNoiseGains[16]
void detectBeat(fl::u32 currentTimeMs)
void calculateBandEnergies()
SilenceEnvelope mDominantFrequencyEnvelope
shared_ptr< Context > mContext
fl::unique_ptr< Processor > mAudioProcessor
Processor & ensureAudioProcessor()
void processFFT(const Sample &sample)
SilenceEnvelope mMagnitudeEnvelope
SignalConditioner mSignalConditioner
NoiseFloorTracker mNoiseFloorTracker
void applyLoudnessCompensation()
SilenceEnvelope mSpectralFluxEnvelope
void applySpectralEqualization()
void updateVolumeAndPeak(const Sample &sample)
float computeAudioDt(fl::size pcmSize, int sampleRate) FL_NOEXCEPT
Compute the time delta (in seconds) for an audio buffer.
CRGB sample(const CRGB *grid, const XYMap &xyMap, float x, float y, SampleMode mode)
Sample a pixel from a 2D CRGB grid at floating-point coordinates.