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 and softhack007 committed Feb 12, 2024
1 parent c9b416a commit d484df0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions usermods/audioreactive/audio_reactive.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ static float fftAvg[NUM_GEQ_CHANNELS] = {0.0f}; // Calculated frequency chann
static float agcSensitivity = 128; // AGC sensitivity estimation, based on agc gain (multAgc). calculated by getSensitivity(). range 0..255

// 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 = 50; // int: attack time in milliseconds. Default 0.08sec
static uint16_t decayTime = 300; // int: decay time in milliseconds. New default 300ms. Old default was 1.40sec

Expand Down Expand Up @@ -1024,7 +1028,7 @@ class AudioReactive : public Usermod {
#define UDPSOUND_MAX_PACKET 96 // max packet size for audiosync, with a bit of "headroom"

// set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
#ifdef SR_ENABLE_DEFAULT
#if defined(SR_ENABLE_DEFAULT) || defined(UM_AUDIOREACTIVE_ENABLE)
bool enabled = true; // WLEDMM
#else
bool enabled = false;
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 d484df0

Please sign in to comment.