From 3b175996882ee2479c06992f0e6cf9685cf70176 Mon Sep 17 00:00:00 2001 From: Mason10198 <31994327+Mason10198@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:05:33 -0500 Subject: [PATCH] v0.4.2 update --- SkywarnPlus.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/SkywarnPlus.py b/SkywarnPlus.py index 91a2af3..ccc07e8 100644 --- a/SkywarnPlus.py +++ b/SkywarnPlus.py @@ -721,17 +721,18 @@ def say_alerts(alerts): alert, ALERT_INDEXES[index], ) - if len(set(descriptions)) > 1 or len(set(end_times)) > 1: - LOGGER.debug( - "sayAlert: Found multiple unique instances of the alert %s", - alert, - ) - multiples_sound = AudioSegment.from_wav( - os.path.join(SOUNDS_PATH, "ALERTS", "SWP_149.wav") - ) - combined_sound += ( - AudioSegment.silent(duration=200) + multiples_sound - ) + if config["Alerting"]["WithMultiples"]: + if len(set(descriptions)) > 1 or len(set(end_times)) > 1: + LOGGER.debug( + "sayAlert: Found multiple unique instances of the alert %s", + alert, + ) + multiples_sound = AudioSegment.from_wav( + os.path.join(SOUNDS_PATH, "ALERTS", "SWP_149.wav") + ) + combined_sound += ( + AudioSegment.silent(duration=200) + multiples_sound + ) alert_count += 1 added_county_codes = set() @@ -951,7 +952,9 @@ def build_tailmessage(alerts): multiples_sound = AudioSegment.from_wav( os.path.join(SOUNDS_PATH, "ALERTS", "SWP_149.wav") ) - combined_sound += AudioSegment.silent(duration=200) + multiples_sound + combined_sound += ( + AudioSegment.silent(duration=200) + multiples_sound + ) # Add county names if they exist if county_identifiers: