# How to trigger a audio sound when an active alarm occur?

**URL:** <https://forum.inductiveautomation.com/t/how-to-trigger-a-audio-sound-when-an-active-alarm-occur/87320>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [March 14, 2024, 10:21am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-a-audio-sound-when-an-active-alarm-occur/87320 "2024-03-14T10:21:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![celo\_Tu](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@celo\_Tu](https://forum.inductiveautomation.com/u/celo_Tu)\
**Post date:** [March 14, 2024, 10:21am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-a-audio-sound-when-an-active-alarm-occur/87320/1 "2024-03-14T10:21:13Z")

</div>

I have a tag for ActiveAlarmCounter.  
When the value no equal zero, trigger a audio file  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/3/53042e1df45f81103a867b9c2e3a556ff958b61f.png)

How to use the  
system.util.playSoundClip(wavFile [, volume] [, wait])  
to make the sound

Is there any way to set a sound on the tag setting?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 14, 2024, 10:26am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-a-audio-sound-when-an-active-alarm-occur/87320/2 "2024-03-14T10:26:51Z")

</div>

From the manual:

> When calling this function from Perspective, the script also executes on the Gateway, meaning the caveat above about allowing services to play sounds is a factor. In addition, **the sound will play on the Gateway** , not the session. To play sounds from a Perspective Session, it's recommended to use the play() component method on the [Perspective Audio](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-audio) component.

> **[system.util.playSoundClip | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-playSoundClip)**
>
> Plays a sound clip from a wav file to the system's default audio device.

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [March 14, 2024, 2:58pm UTC](https://forum.inductiveautomation.com/t/how-to-trigger-a-audio-sound-when-an-active-alarm-occur/87320/3 "2024-03-14T14:58:13Z")

</div>

I normally have a header always fixed to the top of my perspective pages, can add an audio component that plays based on an expression.

> **[Perspective - Audio | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-audio)**
>
> An audio component that Designers can use to play and pause sound clips in the browser.
