Seperate & expose sound effects

pull/45/head
Mason10198 2 years ago
parent 052527a7f3
commit c13235eb74

@ -152,6 +152,5 @@ SWP_143.wav: Tailmessage Enabled
SWP_144.wav: Tailmessage Disabled SWP_144.wav: Tailmessage Disabled
SWP_145.wav: CourtesyTone Enabled SWP_145.wav: CourtesyTone Enabled
SWP_146.wav: CourtesyTone Disabled SWP_146.wav: CourtesyTone Disabled
SWP_147.wav: Tic Sound Effect SWP_147.wav: All Clear Message
SWP_148.wav: All Clear Message SWP_148.wav: Updated Weather Information Message
SWP_149.wav: Updated Weather Information Message

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -112,6 +112,11 @@ enable_idchange = idchange_config.get("Enable", False)
# Data file path # Data file path
data_file = os.path.join(tmp_dir, "data.json") 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 # Define possible alert strings
WS = [ WS = [
"911 Telephone Outage Emergency", "911 Telephone Outage Emergency",
@ -549,12 +554,19 @@ def sayAlert(alerts):
save_state(state) save_state(state)
alert_file = "{}/alert.wav".format(tmp_dir) 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( 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 alert_count = 0
@ -636,7 +648,7 @@ def sayAllClear():
state["last_sayalert"] = [] state["last_sayalert"] = []
save_state(state) 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: if audio_delay > 0:
logger.debug("sayAllClear: Prepending audio with %sms of silence", audio_delay) logger.debug("sayAllClear: Prepending audio with %sms of silence", audio_delay)
@ -644,7 +656,7 @@ def sayAllClear():
silence = AudioSegment.silent(duration=audio_delay) silence = AudioSegment.silent(duration=audio_delay)
combined_sound = silence + alert_clear_sound combined_sound = silence + alert_clear_sound
converted_combined_sound = convertAudio(combined_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") converted_combined_sound.export(alert_clear, format="wav")
node_numbers = config.get("Asterisk", {}).get("Nodes", []) node_numbers = config.get("Asterisk", {}).get("Nodes", [])
@ -677,7 +689,7 @@ def buildTailmessage(alerts):
combined_sound = AudioSegment.empty() combined_sound = AudioSegment.empty()
sound_effect = AudioSegment.from_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"))
) )
for alert in alert_names: for alert in alert_names:
@ -743,9 +755,6 @@ def changeCT(ct):
""" """
state = load_state() state = load_state()
current_ct = state["ct"] current_ct = state["ct"]
tone_dir = config["CourtesyTones"].get(
"ToneDir", os.path.join(sounds_path, "TONES")
)
ct1 = config["CourtesyTones"]["Tones"]["CT1"] ct1 = config["CourtesyTones"]["Tones"]["CT1"]
ct2 = config["CourtesyTones"]["Tones"]["CT2"] ct2 = config["CourtesyTones"]["Tones"]["CT2"]
wx_ct = config["CourtesyTones"]["Tones"]["WXCT"] wx_ct = config["CourtesyTones"]["Tones"]["WXCT"]

@ -43,12 +43,21 @@ Alerting:
# Enable instant voice announcement when new weather alerts are issued. # Enable instant voice announcement when new weather alerts are issued.
SayAlert: true 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. # Specify a WAV file in the root of the SOUNDS directory to be appended to the end of the alert message.
SayAlertSuffix: SayAlertSuffix:
# Enable instant voice announcement when weather alerts are cleared. # Enable instant voice announcement when weather alerts are cleared.
SayAllClear: true 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. # 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. # SkywarnPlus fetches all alerts, orders them by severity, and processes only the 'n' most severe alerts, where 'n' is the MaxAlerts value.
MaxAlerts: 99 MaxAlerts: 99

Loading…
Cancel
Save

Powered by TurnKey Linux.