@C3Sound, I've been playing around with trying to crossfade different engine loops as I was disappointed with the default system in UDK of simply using a single wav and changing it's pitch and volume.
The only way to modify a playing sound's volume and pitch within UDK is to use the [Modify Property] object within Kismet. The only downside to this is that it actually changes the properties of the SoundCue so unless you reset the values when then any other reference to the SoundCue will playback at the new property values.
I did come up with a different solution!
I created my own Custom PlaySound object for use within Kismet. This object enables you to apply a fade to a given value over a given time by passing variables and then triggering the object.
I also set it up so that if your SoundCue has a Continuous Modulator within it then you can pass additional variables from the Custom PlaySound object to the CM so that you also have control over the pitch of a sound.
here's the source code of the object so you can experiment with it.
If you've not done any scripting before, just copy the following text and paste it into a text editor and save as "SeqAct_GATPlaySound.uc", then recompile your scripts. The object should appear within Kismet next time you run the Editor.
/**
*
* Generates Kismet errors if "Targetted" to a specific actor.
* - the AudioComponent doesn't have a spatialise function by default
* --- working on a fix
*
*/
class SeqAct_GATPlaySound extends SequenceAction;
// defining variables
var() AudioComponent mySoundAC;
var float myFadeTime;
var float myFadeLevel;
var() name CMParamName;
var float CMParamValue;
function Activated()
{
if (InputLinks[0].bHasImpulse) // Plays Sound (quick fade in)
{
mySoundAC.FadeIn(0.2f,1.0f);
}
if (InputLinks[1].bHasImpulse) // Stops Sound (quick fade out)
{
mySoundAC.FadeOut(0.2f,0.0f);
}
if (InputLinks[2].bHasImpulse) // Fade Sound according to user defined values
{
mySoundAC.AdjustVolume(myFadeTime,myFadeLevel); // (fade time (f), end volume (f))
}
if (InputLinks[3].bHasImpulse) //Pass incoming value to the Coninuous Modulator (Param. defined within properties)
{
mySoundAC.SetFloatParameter(CMParamName, CMParamValue); //CMParamName = Name within Cont. Mod.
}
}
defaultproperties
{
Begin Object Class=AudioComponent Name=YourSoundSound //"imports" AudioComponent functionality
End Object
mySoundAC=YourSoundSound // defines the AudioComponent
ObjName="GATPlaySound" // the name of the object as it appears in the New Action menu
ObjCategory="GATKismetActions" // where the object will appear within the New Action menu
// defining input links
InputLinks(0)=(LinkDesc="Play")
InputLInks(1)=(LinkDesc="Stop")
InputLInks(2)=(LinkDesc="Trigger Fade")
InputLinks(3)=(LinkDesc="Pass to Cont. Mod.")
// defining variable links
VariableLinks(0)=(ExpectedType=class'SeqVar_Float',LinkDesc="Fade Time",PropertyName=myFadeTime)
VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="Fade Level",PropertyName=myFadeLevel)
VariableLinks(2)=(ExpectedType=class'SeqVar_Float',LinkDesc="CM Param Value",PropertyName=CMParamValue)
VariableLinks(3)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)
}
If you have any questions about the object, I'd be happy to help out.
PS. This object was developed as part of an upcoming book I'm working on (with a colleague) called the Game Audio Tutorial - which looks at practical implementation of audio within the UDK engine. Due out 29th March.
Amazon Link
Hope this helps,
teed