Hi, so ive got scripts that play sound files fine with audaspace but iv been having trouble altering the created factory volume every frame. (this is for altering large amounts of sounds on the fly) However if I use the handle method way something like (handle.volume = mastersfx) im able to send this to an update def in a part of the script to run every frame.
Its just if I use the factory handle way instead of doing it at the audaspace factory level I lose the control of then reducing the volume of specific sounds at audaspaces handle.volume level.
So if you see the test script its trying to send the factory function “(factory = factory.volume(s)” over to the update def with a key, however the volume isn’t being updated from the property “volumeporperty”. Annoyingly the script throws no errors back at me, even more annoying if I send over the created factory handle for volume it updates just fine.
from bge import logic
import aud
scene = logic.getCurrentScene()
o = logic.getCurrentController().owner
device = aud.device()
s = o.get("volumeproperty")
def play():
file = logic.expandPath("sounds") + "/somesoundfile.wav"
factory = aud.Factory(file)
#can set factory volume on first play with this line
#factory = factory.volume(s)
handle = device.play(factory)
handle.volume = 1.00
#need to able to send over "factory = factory.volume(s)" to "update def" with this line
o["factory"] = factory
def update(cont):
o = cont.owner
s = o.get("volumeproperty")
o["factory"].volume(s)