Sound Player

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.


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

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

Thank you!

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