@@ -140,7 +140,7 @@ static uint8_t binNum = 8; // Used to select the bin for FFT based bea
140140#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)
141141#define UM_AUDIOREACTIVE_USE_INTEGER_FFT // always use integer FFT on ESP32-S2 and ESP32-C3
142142#endif
143- #endif
143+ #endif // UM_AUDIOREACTIVE_USE_ARDUINO_FFT
144144
145145#if !defined(UM_AUDIOREACTIVE_USE_INTEGER_FFT)
146146using FFTsampleType = float ;
@@ -758,6 +758,8 @@ class AudioReactive : public Usermod {
758758 private:
759759#ifdef ARDUINO_ARCH_ESP32
760760
761+ static constexpr uint8_t SR_DMTYPE_NETWORK_ONLY = 254 ;
762+
761763 #ifndef AUDIOPIN
762764 int8_t audioPin = -1 ;
763765 #else
@@ -1439,7 +1441,7 @@ class AudioReactive : public Usermod {
14391441 break ;
14401442 #endif
14411443
1442- case 254 : // dummy "network receive only" mode
1444+ case SR_DMTYPE_NETWORK_ONLY : // dummy "network receive only" mode
14431445 if (audioSource) delete audioSource; audioSource = nullptr ;
14441446 disableSoundProcessing = true ;
14451447 audioSyncEnabled = 2 ; // force udp sound receive mode
@@ -1456,19 +1458,25 @@ class AudioReactive : public Usermod {
14561458 }
14571459 delay (250 ); // give microphone enough time to initialise
14581460
1459- if (!audioSource && (dmType != 254 )) enabled = false ;// audio failed to initialise
1461+ if (!audioSource && (dmType != SR_DMTYPE_NETWORK_ONLY )) enabled = false ;// audio failed to initialise
14601462#endif
14611463 if (enabled) onUpdateBegin (false ); // create FFT task, and initialize network
14621464
14631465
14641466#ifdef ARDUINO_ARCH_ESP32
1465- if (FFT_Task == nullptr ) enabled = false ; // FFT task creation failed
1467+ if (audioSource && FFT_Task == nullptr ) enabled = false ; // FFT task creation failed
14661468 if ((!audioSource) || (!audioSource->isInitialized ())) { // audio source failed to initialize. Still stay "enabled", as there might be input arriving via UDP Sound Sync
1467- #ifdef WLED_DEBUG
1468- DEBUG_PRINTLN (F (" AR: Failed to initialize sound input driver. Please check input PIN settings." ));
1469- #else
1470- DEBUGSR_PRINTLN (F (" AR: Failed to initialize sound input driver. Please check input PIN settings." ));
1471- #endif
1469+ #ifdef WLED_DEBUG
1470+ #define AR_INIT_DEBUG_PRINT DEBUG_PRINTLN
1471+ #else
1472+ #define AR_INIT_DEBUG_PRINT DEBUGSR_PRINTLN
1473+ #endif
1474+ if (dmType == SR_DMTYPE_NETWORK_ONLY ) {
1475+ AR_INIT_DEBUG_PRINT (F (" AR: No sound input driver configured - network receive only." ));
1476+ } else {
1477+ AR_INIT_DEBUG_PRINT (F (" AR: Failed to initialize sound input driver. Please check input PIN settings." ));
1478+ }
1479+ #undef AR_INIT_DEBUG_PRINT
14721480 disableSoundProcessing = true ;
14731481 }
14741482#endif
@@ -2123,6 +2131,9 @@ class AudioReactive : public Usermod {
21232131 uiScript.print (F (" addOption(dd,'Generic PDM',5);" ));
21242132 #endif
21252133 uiScript.print (F (" addOption(dd,'ES8388',6);" ));
2134+ uiScript.print (F (" addOption(dd,'None - network receive only'," ));
2135+ uiScript.print (SR_DMTYPE_NETWORK_ONLY );
2136+ uiScript.print (F (" );" ));
21262137
21272138 uiScript.print (F (" dd=addDropdown(ux,'config:AGC');" ));
21282139 uiScript.print (F (" addOption(dd,'Off',0);" ));
0 commit comments