Skip to content

Commit

Permalink
AR: fix for arduinoFFT 2.x API
Browse files Browse the repository at this point in the history
in contrast to previous 'dev' versions, the storage for windowWeighingFactors is now managed internally by the arduinoFFT object.
  • Loading branch information
softhack007 committed May 4, 2024
1 parent cd5494f commit 3f9a6ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usermods/audioreactive/audio_reactive.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ constexpr uint16_t samplesFFT_2 = 256; // meaningfull part of FFT resul
// These are the input and output vectors. Input vectors receive computed results from FFT.
static float vReal[samplesFFT] = {0.0f}; // FFT sample inputs / freq output - these are our raw result bins
static float vImag[samplesFFT] = {0.0f}; // imaginary parts
static float windowWeighingFactors[samplesFFT] = {0.0f};

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

#include <arduinoFFT.h>

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

// Helper functions

Expand Down

0 comments on commit 3f9a6ca

Please sign in to comment.