Sound alert for unacknowledged alarm

Im currently trying to find the best way to have an alarm sound (.wav) play when any alarm becomes active. All of my alarms are critical so this will apply to all alarms. I have tried using a client event script in which I can load in my tags to play when there value has changed, but this seems to only work with Boolean values. The bulk of my alarm tags are DI and are integer values.

Im not very skilled with Ignition but I’m working on that. Has anyone attempted to do something like this? If so, is there any advice on how I should go about accomplishing this? I have included a snippet of the code Im trying to use. Once again, works great with boolean tags but not integers or float values (12.6 etc…).

#Plays oneshot .wav file anytime background state changes to red.

when this label turns red, play the alarm audible

#if event.propertyName == ‘background’:
#if “r=255,g=0,b=0” in str(event.newValue):
#print “Alarm Sound”
#system.util.playSoundClip(“C:\Windows\Media\Windows Unlock.wav”,1,0)

Is this for vision? If so you can use the sound player
image

Then bind the trigger to something that indicates an alarm is active. In my projects that use it i have a bit in the plc “anyAlarmActive” that I use to play the sound.

I ended up creating a sound player on the navigation bar. From there I created a custom parameter that is bound to the gateway active unacknowledged count. From there, I used a on parameter change script to check if the custom parameter is greater than 0. If so, the sound player’s trigger property would change to true.

Thank you for you help. Fortunately I was able to find a simple solution.