Skip to content

Commit 3f9a6ca

Browse files
committed
AR: fix for arduinoFFT 2.x API
in contrast to previous 'dev' versions, the storage for windowWeighingFactors is now managed internally by the arduinoFFT object.
1 parent cd5494f commit 3f9a6ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

usermods/audioreactive/audio_reactive.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ constexpr uint16_t samplesFFT_2 = 256; // meaningfull part of FFT resul
183183
// These are the input and output vectors. Input vectors receive computed results from FFT.
184184
static float vReal[samplesFFT] = {0.0f}; // FFT sample inputs / freq output - these are our raw result bins
185185
static float vImag[samplesFFT] = {0.0f}; // imaginary parts
186-
static float windowWeighingFactors[samplesFFT] = {0.0f};
187186

188187
// Create FFT object
189188
// lib_deps += https://github.com/kosme/arduinoFFT#develop @ 1.9.2
@@ -196,7 +195,8 @@ static float windowWeighingFactors[samplesFFT] = {0.0f};
196195

197196
#include <arduinoFFT.h>
198197

199-
static ArduinoFFT<float> FFT = ArduinoFFT<float>( vReal, vImag, samplesFFT, SAMPLE_RATE, windowWeighingFactors);
198+
/* Create FFT object with weighing factor storage */
199+
static ArduinoFFT<float> FFT = ArduinoFFT<float>( vReal, vImag, samplesFFT, SAMPLE_RATE, true);
200200

201201
// Helper functions
202202

0 commit comments

Comments
 (0)