diff --git a/SOUNDS/ALERTS/DICTIONARY.txt b/SOUNDS/ALERTS/DICTIONARY.txt index 02c3251..742091a 100644 --- a/SOUNDS/ALERTS/DICTIONARY.txt +++ b/SOUNDS/ALERTS/DICTIONARY.txt @@ -152,6 +152,5 @@ SWP_143.wav: Tailmessage Enabled SWP_144.wav: Tailmessage Disabled SWP_145.wav: CourtesyTone Enabled SWP_146.wav: CourtesyTone Disabled -SWP_147.wav: Tic Sound Effect -SWP_148.wav: All Clear Message -SWP_149.wav: Updated Weather Information Message \ No newline at end of file +SWP_147.wav: All Clear Message +SWP_148.wav: Updated Weather Information Message \ No newline at end of file diff --git a/SOUNDS/ALERTS/SWP_147.wav b/SOUNDS/ALERTS/SWP_147.wav index 94dbf2e..e5c4399 100644 Binary files a/SOUNDS/ALERTS/SWP_147.wav and b/SOUNDS/ALERTS/SWP_147.wav differ diff --git a/SOUNDS/ALERTS/SWP_148.wav b/SOUNDS/ALERTS/SWP_148.wav index f5999d6..b5e9966 100644 Binary files a/SOUNDS/ALERTS/SWP_148.wav and b/SOUNDS/ALERTS/SWP_148.wav differ diff --git a/SOUNDS/ALERTS/SWP_149.wav b/SOUNDS/ALERTS/SWP_149.wav deleted file mode 100644 index 584c25a..0000000 Binary files a/SOUNDS/ALERTS/SWP_149.wav and /dev/null differ diff --git a/SOUNDS/ALERTS/StartrekWhistle.wav b/SOUNDS/ALERTS/StartrekWhistle.wav new file mode 100644 index 0000000..38c97db Binary files /dev/null and b/SOUNDS/ALERTS/StartrekWhistle.wav differ diff --git a/SOUNDS/ALERTS/Triangles.wav b/SOUNDS/ALERTS/Triangles.wav new file mode 100644 index 0000000..dc107c9 Binary files /dev/null and b/SOUNDS/ALERTS/Triangles.wav differ diff --git a/SOUNDS/ALERTS/Woodblock.wav b/SOUNDS/ALERTS/Woodblock.wav new file mode 100644 index 0000000..94dbf2e Binary files /dev/null and b/SOUNDS/ALERTS/Woodblock.wav differ diff --git a/SkywarnPlus.py b/SkywarnPlus.py index 62d284b..ba5953e 100644 --- a/SkywarnPlus.py +++ b/SkywarnPlus.py @@ -112,6 +112,11 @@ enable_idchange = idchange_config.get("Enable", False) # Data file path data_file = os.path.join(tmp_dir, "data.json") +# Tones directory +tone_dir = config["CourtesyTones"].get( + "ToneDir", os.path.join(sounds_path, "TONES") +) + # Define possible alert strings WS = [ "911 Telephone Outage Emergency", @@ -549,12 +554,19 @@ def sayAlert(alerts): save_state(state) alert_file = "{}/alert.wav".format(tmp_dir) + + word_space = AudioSegment.silent(duration=600) - combined_sound = AudioSegment.from_wav( - os.path.join(sounds_path, "ALERTS", "SWP_149.wav") - ) sound_effect = AudioSegment.from_wav( - os.path.join(sounds_path, "ALERTS", "SWP_147.wav") + os.path.join(sounds_path, "ALERTS", config.get("Alerting", {}).get("AlertSeperator", "Woodblock.wav")) + ) + + intro_effect = AudioSegment.from_wav( + os.path.join(sounds_path, "ALERTS", config.get("Alerting", {}).get("AlertSound", "StartrekWhistle.wav")) + ) + + combined_sound = intro_effect + word_space + AudioSegment.from_wav( + os.path.join(sounds_path, "ALERTS", "SWP_148.wav") ) alert_count = 0 @@ -636,7 +648,7 @@ def sayAllClear(): state["last_sayalert"] = [] save_state(state) - alert_clear = os.path.join(sounds_path, "ALERTS", "SWP_148.wav") + alert_clear = os.path.join(sounds_path, "ALERTS", "SWP_147.wav") if audio_delay > 0: logger.debug("sayAllClear: Prepending audio with %sms of silence", audio_delay) @@ -644,7 +656,7 @@ def sayAllClear(): silence = AudioSegment.silent(duration=audio_delay) combined_sound = silence + alert_clear_sound converted_combined_sound = convertAudio(combined_sound) - alert_clear = os.path.join(tmp_dir, "SWP_148.wav") + alert_clear = os.path.join(tmp_dir, "SWP_147.wav") converted_combined_sound.export(alert_clear, format="wav") node_numbers = config.get("Asterisk", {}).get("Nodes", []) @@ -677,7 +689,7 @@ def buildTailmessage(alerts): combined_sound = AudioSegment.empty() sound_effect = AudioSegment.from_wav( - os.path.join(sounds_path, "ALERTS", "SWP_147.wav") + os.path.join(sounds_path, "ALERTS", config.get("Alerting", {}).get("AlertSeperator", "Woodblock.wav")) ) for alert in alert_names: @@ -743,9 +755,6 @@ def changeCT(ct): """ state = load_state() current_ct = state["ct"] - tone_dir = config["CourtesyTones"].get( - "ToneDir", os.path.join(sounds_path, "TONES") - ) ct1 = config["CourtesyTones"]["Tones"]["CT1"] ct2 = config["CourtesyTones"]["Tones"]["CT2"] wx_ct = config["CourtesyTones"]["Tones"]["WXCT"] diff --git a/config.yaml b/config.yaml index 27c933b..9b92276 100644 --- a/config.yaml +++ b/config.yaml @@ -43,12 +43,21 @@ Alerting: # Enable instant voice announcement when new weather alerts are issued. SayAlert: true + # Specify the WAV file in the SOUNDS/ALERTS directory to use as the alert sound effect + AlertSound: StartrekWhistle.wav + # Specify a WAV file in the root of the SOUNDS directory to be appended to the end of the alert message. SayAlertSuffix: # Enable instant voice announcement when weather alerts are cleared. SayAllClear: true + # Specify the WAV file in the SOUNDS/ALERTS directory to use as the all clear sound effect. + AllClearSound: Triangles.wav + + # Specify the WAV file in the SOUNDS/ALERTS directory to use as the alert seperator sound effect + AlertSeperator: Woodblock.wav + # Limit the maximum number of alerts to process in case of multiple alerts. # SkywarnPlus fetches all alerts, orders them by severity, and processes only the 'n' most severe alerts, where 'n' is the MaxAlerts value. MaxAlerts: 99