v0.2.5 update

pull/34/head
Mason10198 3 years ago
parent 20cba48fb7
commit a1be2c344e

@ -15,7 +15,7 @@ This includes features such as automatic voice alerts and a tail message feature
for constant updates. All alerts are sorted by severity and cover a broad range for constant updates. All alerts are sorted by severity and cover a broad range
of weather conditions such as hurricane warnings, thunderstorms, heat waves, etc. of weather conditions such as hurricane warnings, thunderstorms, heat waves, etc.
Configurable through a .ini file, SkywarnPlus serves as a comprehensive and Configurable through a .yaml file, SkywarnPlus serves as a comprehensive and
flexible tool for those who need to stay informed about weather conditions flexible tool for those who need to stay informed about weather conditions
and disseminate this information through their radio repeater system. and disseminate this information through their radio repeater system.
""" """
@ -506,6 +506,14 @@ def sayAlert(alerts):
logger.debug("sayAlert: All alerts were blocked, not broadcasting any alerts.") logger.debug("sayAlert: All alerts were blocked, not broadcasting any alerts.")
return return
alert_suffix = config.get("Alerting", {}).get("SayAlertSuffix", None)
if alert_suffix is not None:
suffix_silence = AudioSegment.silent(duration=1000)
logger.debug("sayAlert: Adding alert suffix %s", alert_suffix)
suffix_file = os.path.join(sounds_path, alert_suffix)
suffix_sound = AudioSegment.from_wav(suffix_file)
combined_sound += suffix_silence + suffix_sound
logger.debug("sayAlert: Exporting alert sound to %s", alert_file) logger.debug("sayAlert: Exporting alert sound to %s", alert_file)
converted_combined_sound = convertAudio(combined_sound) converted_combined_sound = convertAudio(combined_sound)
converted_combined_sound.export(alert_file, format="wav") converted_combined_sound.export(alert_file, format="wav")
@ -570,6 +578,9 @@ def buildTailmessage(alerts):
# Extract only the alert names from the OrderedDict keys # Extract only the alert names from the OrderedDict keys
alert_names = [alert[0] for alert in alerts.keys()] alert_names = [alert[0] for alert in alerts.keys()]
# Get the suffix config
tailmessage_suffix = config.get("Tailmessage", {}).get("TailmessageSuffix", None)
if not alerts: if not alerts:
logger.info("buildTailMessage: No alerts, creating silent tailmessage") logger.info("buildTailMessage: No alerts, creating silent tailmessage")
silence = AudioSegment.silent(duration=100) silence = AudioSegment.silent(duration=100)
@ -617,6 +628,14 @@ def buildTailmessage(alerts):
"buildTailMessage: All alerts were blocked, creating silent tailmessage" "buildTailMessage: All alerts were blocked, creating silent tailmessage"
) )
combined_sound = AudioSegment.silent(duration=100) combined_sound = AudioSegment.silent(duration=100)
elif tailmessage_suffix is not None:
suffix_silence = AudioSegment.silent(duration=1000)
logger.debug(
"buildTailMessage: Adding tailmessage suffix %s", tailmessage_suffix
)
suffix_file = os.path.join(sounds_path, tailmessage_suffix)
suffix_sound = AudioSegment.from_wav(suffix_file)
combined_sound += suffix_silence + suffix_sound
logger.info("Built new tailmessage") logger.info("Built new tailmessage")
logger.debug("buildTailMessage: Exporting tailmessage to %s", tailmessage_file) logger.debug("buildTailMessage: Exporting tailmessage to %s", tailmessage_file)

@ -50,6 +50,10 @@ Alerting:
SayAlert: true SayAlert: true
# #
# #
# 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. # Enable instant voice announcement when weather alerts are cleared.
# Set to 'True' for enabling or 'False' for disabling. # Set to 'True' for enabling or 'False' for disabling.
# Example: SayAllClear: true # Example: SayAllClear: true
@ -66,8 +70,6 @@ Alerting:
#SoundsPath: #SoundsPath:
# #
# #
# Specify a
SayAlertSuffix:
################################################################################################################################ ################################################################################################################################
@ -103,6 +105,10 @@ Tailmessage:
Enable: false Enable: false
# #
# #
# Specify a WAV file in the root of the SOUNDS directory to be appended to the end of the tail message.
#TailmessageSuffix:
#
#
# Specify an alternative path and filename for saving the tail message. # Specify an alternative path and filename for saving the tail message.
# Default is /tmp/SkywarnPlus/wx-tail.wav. # Default is /tmp/SkywarnPlus/wx-tail.wav.
#TailmessagePath: #TailmessagePath:

Loading…
Cancel
Save

Powered by TurnKey Linux.