AR bugfix
prevents crash in case that audioSource creation (audio startup) failed
This commit is contained in:
parent
bdea3d4959
commit
c114ea6b30
@ -1335,7 +1335,7 @@ class AudioReactive : public Usermod {
|
|||||||
disableSoundProcessing = true;
|
disableSoundProcessing = true;
|
||||||
} else {
|
} else {
|
||||||
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_DEBUG)
|
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_DEBUG)
|
||||||
if ((disableSoundProcessing == true) && (audioSyncEnabled == 0) && audioSource->isInitialized()) { // we just switched to "enabled"
|
if ((disableSoundProcessing == true) && (audioSyncEnabled == 0) && audioSource && audioSource->isInitialized()) { // we just switched to "enabled"
|
||||||
DEBUG_PRINTLN(F("[AR userLoop] realtime mode ended - audio processing resumed."));
|
DEBUG_PRINTLN(F("[AR userLoop] realtime mode ended - audio processing resumed."));
|
||||||
DEBUG_PRINTF_P(PSTR(" RealtimeMode = %d; RealtimeOverride = %d\n"), int(realtimeMode), int(realtimeOverride));
|
DEBUG_PRINTF_P(PSTR(" RealtimeMode = %d; RealtimeOverride = %d\n"), int(realtimeMode), int(realtimeOverride));
|
||||||
}
|
}
|
||||||
@ -1347,7 +1347,7 @@ class AudioReactive : public Usermod {
|
|||||||
if (audioSyncEnabled & 0x02) disableSoundProcessing = true; // make sure everything is disabled IF in audio Receive mode
|
if (audioSyncEnabled & 0x02) disableSoundProcessing = true; // make sure everything is disabled IF in audio Receive mode
|
||||||
if (audioSyncEnabled & 0x01) disableSoundProcessing = false; // keep running audio IF we're in audio Transmit mode
|
if (audioSyncEnabled & 0x01) disableSoundProcessing = false; // keep running audio IF we're in audio Transmit mode
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
if (!audioSource->isInitialized()) disableSoundProcessing = true; // no audio source
|
if (!audioSource || !audioSource->isInitialized()) disableSoundProcessing = true; // no audio source
|
||||||
|
|
||||||
|
|
||||||
// Only run the sampling code IF we're not in Receive mode or realtime mode
|
// Only run the sampling code IF we're not in Receive mode or realtime mode
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user