Skip to content

Commit

Permalink
Merge pull request Aircoookie#3732 from wled-install/patch-1
Browse files Browse the repository at this point in the history
UM Audioreactive: add two compiler options
  • Loading branch information
blazoncek authored Feb 1, 2024
2 parents 2b0fad8 + 917a981 commit 3d6f25a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion usermods/audioreactive/audio_reactive.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ static uint8_t audioSyncEnabled = 0; // bit field: bit 0 - send, bit 1
static bool udpSyncConnected = false; // UDP connection status -> true if connected to multicast group

// user settable parameters for limitSoundDynamics()
static bool limiterOn = true; // bool: enable / disable dynamics limiter
#ifdef UM_AUDIOREACTIVE_DYNAMICS_LIMITER_OFF
static bool limiterOn = false; // bool: enable / disable dynamics limiter
#else
static bool limiterOn = true;
#endif
static uint16_t attackTime = 80; // int: attack time in milliseconds. Default 0.08sec
static uint16_t decayTime = 1400; // int: decay time in milliseconds. Default 1.40sec
// user settable options for FFTResult scaling
Expand Down Expand Up @@ -612,7 +616,12 @@ class AudioReactive : public Usermod {
};

// set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
#ifdef UM_AUDIOREACTIVE_ENABLE
bool enabled = true;
#else
bool enabled = false;
#endif

bool initDone = false;

// variables for UDP sound sync
Expand Down
5 changes: 5 additions & 0 deletions usermods/audioreactive/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ If you want to define default GPIOs during compile time, use the following (defa
- `-D ES7243_SDAPIN` : GPIO for I2C SDA pin on ES7243 microphone (-1)
- `-D ES7243_SCLPIN` : GPIO for I2C SCL pin on ES7243 microphone (-1)

Other options:

- `-D UM_AUDIOREACTIVE_ENABLE` : makes usermod default enabled (not the same as include into build option!)
- `-D UM_AUDIOREACTIVE_DYNAMICS_LIMITER_OFF` : disables rise/fall limiter default

**NOTE** I2S is used for analog audio sampling. Hence, the analog *buttons* (i.e. potentiometers) are disabled when running this usermod with an analog microphone.

### Advanced Compile-Time Options
Expand Down

0 comments on commit 3d6f25a

Please sign in to comment.