You can use single channel for esp8266 (there is the only A0 port) or stereo for ESP32
Single channel is only tested with MAX9814 microphone module. It has audio amplifier built in. Tried with KY-037, but it's a lot worse.
Wiring is simple:
- GND - GND
- Vcc - Vin
- Out - 100kOhm - VP
Stereo channel is tested with two audio jacks, one for input, second for output. It's a bit noisy at the end. Requires some filtration. Feel free to improve!
Wiring diagram is taken from: https://github.com/G6EJD/ESP32-8-Octave-Audio-Spectrum-Display/blob/master/Stereo_Input_Wiring.jpg
R1, R2, R3, R4 are 110kOhm Capacitors are 47nF
To use audio signal in effects uncomment last lines in https://github.com/CODeRUS/GyverLampCpp/blob/master/src/EffectsManager.cpp:
- SoundEffect for mono channel
- SoundStereoEffect for stereo channels
To use the effects after uncommenting them in EffectsManager.cpp, you have to add them to the effects,json file like this for single channel:
and like this for stereo channel:
Of course items like name (n), color and hColor (heatColor) are customizable.