# Sound Player

**URL:** <https://forum.inductiveautomation.com/t/sound-player/3520>\
**Category:** Ignition\
**Created:** [October 28, 2011, 6:27pm UTC](https://forum.inductiveautomation.com/t/sound-player/3520 "2011-10-28T18:27:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [October 28, 2011, 6:27pm UTC](https://forum.inductiveautomation.com/t/sound-player/3520/1 "2011-10-28T18:27:07Z")

</div>

is it possible to change the sound player “sound data” property from the runtime environment?  
I have a client who desires to be able to select and change the .wav files that play for different events (alarms, warnings, etc.) i figured i would be able to just modify the sound data property from a script or dynamic property or something like that but am unsuccessful.

Thanks,  
Scott

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 28, 2011, 6:32pm UTC](https://forum.inductiveautomation.com/t/sound-player/3520/2 "2011-10-28T18:32:58Z")

</div>

Yes, you can read in a sound file and set it on the sound player component. Here is an example from a button.`path = system.file.openFile("wav")
if path != None:
    bytes = system.file.readFileAsBytes(path)
    event.source.parent.getComponent("Sound Player").soundData = bytes`

---

<div class="post-metadata">

**Author:** ![nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nathan](https://forum.inductiveautomation.com/u/nathan)\
**Post date:** [October 28, 2011, 7:15pm UTC](https://forum.inductiveautomation.com/t/sound-player/3520/3 "2011-10-28T19:15:56Z")

</div>

Travis - mind providing a code sample for how you would load it in as a BLOB from the database?

---

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [October 28, 2011, 7:42pm UTC](https://forum.inductiveautomation.com/t/sound-player/3520/4 "2011-10-28T19:42:11Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 28, 2011, 7:56pm UTC](https://forum.inductiveautomation.com/t/sound-player/3520/5 "2011-10-28T19:56:50Z")

</div>

Sure:`bytes = system.db.runScalarQuery("SELECT soundbytes FROM soundtable WHERE id = 1")
event.source.parent.getComponent("Sound Player").soundData = bytes`
