# How To create script to automation ON or OFF sound

**URL:** <https://forum.inductiveautomation.com/t/how-to-create-script-to-automation-on-or-off-sound/92062>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 19, 2024, 6:58am UTC](https://forum.inductiveautomation.com/t/how-to-create-script-to-automation-on-or-off-sound/92062 "2024-06-19T06:58:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hisyam\_agung](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@hisyam\_agung](https://forum.inductiveautomation.com/u/hisyam_agung)\
**Post date:** [June 19, 2024, 6:58am UTC](https://forum.inductiveautomation.com/t/how-to-create-script-to-automation-on-or-off-sound/92062/1 "2024-06-19T06:58:42Z")

</div>

Hello Everyone,  
I want to ask. Currently, I have some problems with my project.  
I have several screens that have the requirement to make automation turn off and turn on sound based on a bit from the tag address.  
Can you guide me on how to make some script when tags have value 1 so the sound will be active until the value changes to 0 to turn off the sound?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [June 19, 2024, 7:14am UTC](https://forum.inductiveautomation.com/t/how-to-create-script-to-automation-on-or-off-sound/92062/2 "2024-06-19T07:14:31Z")

</div>

You can play a sound with this (if the sound is on)

> **[Perspective - Audio | Ignition User Manual](https://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.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 19, 2024, 7:25am UTC](https://forum.inductiveautomation.com/t/how-to-create-script-to-automation-on-or-off-sound/92062/3 "2024-06-19T07:25:43Z")

</div>

What do you mean, turn sound on and off ? What sound ?

---

<div class="post-metadata">

**Author:** ![hisyam\_agung](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@hisyam\_agung](https://forum.inductiveautomation.com/u/hisyam_agung)\
**Post date:** [June 19, 2024, 7:38am UTC](https://forum.inductiveautomation.com/t/how-to-create-script-to-automation-on-or-off-sound/92062/4 "2024-06-19T07:38:28Z")

</div>

Sorry my bad, I mean audio-component in perspective

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 19, 2024, 7:59am UTC](https://forum.inductiveautomation.com/t/how-to-create-script-to-automation-on-or-off-sound/92062/5 "2024-06-19T07:59:22Z")

</div>

Well then you can just bind the `play` property to your tag. The only scripting you might need is in a a transform to convert whatever value your tag hold into a boolean, though you should be able to do this with an [expression](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/logic/getBit)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e1746a63555809395b0b4acb491863e00332bb40.png)
