diff --git a/platformio.ini b/platformio.ini index c6d74224..1621f0fb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -154,7 +154,7 @@ build_flags = ; -D ML_RGBW=1 ; define whether to enable RGBW (1 = yes, 0 = no) ... could be derived from ML_CHIPSET??? lib_deps = https://github.com/FastLED/FastLED.git#3.10.3 ; sept 2025 - https://github.com/ewowi/WLED-sync#25f280b5e8e47e49a95282d0b78a5ce5301af4fe ; sourceIP + fftUdp.clear() if arduino >=3 (20251104) + https://github.com/netmindz/WLED-AudioReactive-Usermod.git#OO-split ; Audio Sync library ; 💫 currently only enabled on s3 as esp32dev runs over 100% [livescripts] diff --git a/src/MoonLight/Nodes/Drivers/D_AudioSync.h b/src/MoonLight/Nodes/Drivers/D_AudioSync.h index 8b74a8e7..a2c3b9c3 100644 --- a/src/MoonLight/Nodes/Drivers/D_AudioSync.h +++ b/src/MoonLight/Nodes/Drivers/D_AudioSync.h @@ -11,7 +11,7 @@ #if FT_MOONLIGHT - #include // https://github.com/netmindz/WLED-sync + #include // https://github.com/netmindz/WLED-AudioReactive-Usermod #include class AudioSyncDriver : public Node { @@ -20,7 +20,7 @@ class AudioSyncDriver : public Node { static uint8_t dim() { return _NoD; } static const char* tags() { return "☸️♫"; } - WLEDSync sync; + AudioSync sync; bool init = false; void loop() override { @@ -39,16 +39,21 @@ class AudioSyncDriver : public Node { } if (!init) { + AudioSync::Config config; + config.enableReceive = true; + config.enableTransmit = false; + sync.configure(config); sync.begin(); init = true; EXT_LOGI(ML_TAG, "Audio Sync: Initialized"); } - if (sync.read()) { - memcpy(sharedData.bands, sync.fftResult, sizeof(sharedData.bands)); - sharedData.volume = sync.volumeSmth; - sharedData.volumeRaw = sync.volumeRaw; - sharedData.majorPeak = sync.FFT_MajorPeak; + if (sync.receive()) { + const AudioSync::ReceivedData& data = sync.getReceivedData(); + memcpy(sharedData.bands, data.fftResult, sizeof(sharedData.bands)); + sharedData.volume = data.volumeSmth; + sharedData.volumeRaw = data.volumeRaw; + sharedData.majorPeak = data.fftMajorPeak; moduleControl->read( [&](const ModuleState& state) {