Queueing sounds & Changing sounds on the fly in 2.5+?

Hey guys,

I’m trying to setup up a little Python script that allows me to queue audio for sound actuators.

As in, you play a certain sound and then you wish to play another sound but you want it to be played after the first sound has finished.

It’d be nice if I wouldn’t have to hardcode the lengths of the audio files.

Kind regards.

Also I am for some reason unable to change sounds on the fly.

I noticed that KX_SoundActuator.fileName is now actually called KX_SoundActuator.sound .
But it doesn’t accept filenames. Only datablocks but I have no clue how to get those.

You can go to the outliner and select the datablock view, open the sound category and you should see the datablock names when opening the statistics for each sound.

OK. Changing the filepath of a datablack during run-time isn’t a smart thing to do. XD My Blender crashed.
I was trying to change the block’s filepath since I don’t know how to assign a different datablock in Python.

No answer but… if You play sounds from python anyway I would suggest trying the aud module instead of the actuator.

I didn’t know about this module. Looks pretty cool. I’ll try it out tomorrow. 3 AM here. XD

LaH’s right. To my knowledge, there’s no way to change the audio using a filepath with the sound logic brick. However, the Audaspace module automatically loads sounds from a filepath. There’s no way to pack sounds that you use with Audaspace into the blend file, though.

I’ve been playing around with Audaspace for a little. I’m using external files for my game anyway.

I was wondering if it’s possible to update a factory/handle without having to stop the sound and play it again.
To for example have a sliding lowpass value. I got lowpass to work but only when the sound has just been created.
Is it possible to change it in real time?

It looks like it’s doing a decent job so far.
Here’s a video of a simple event-drive music system I’ve setup.

This is a great Achievement, actually! Realtime Music, just the Way I like it. I once attempted to do that, but a Lack of Motivation made me stop…
Though in the Video it looks like the Action State plays on even though it says the Stealth State was active. Though maybe I just don’t get something here…

It waits for the current loop to finish then it plays the loop of the state. You can also directly trigger it using a stinger event.