Volume Control In runtime....

I Want to control Volume of each Cue In My Code.

I use this code:

Index = pCue->GetVariableIndex( "Volume" );
pCue->SetVariable( Index, (XACTVARIABLEVALUE) fVolume );

but Index Value is 65535....

Of Cource, I Create and Link RPC In XACT Creation tool..

please teach me...

How can Control Volume in runtime ?

[370 byte] By [Henzrake] at [2008-2-17]
# 1

I'm assuming that you are creating a variable called Volume in the GUI and linking to the sounds volume, then attaching that sound to an RPC with your desired volume curve.

Before you call SetVariable on a cue, you first need to prepare on the Cue.

SoundBank->Prepare(CueIndex, 0, 0, &pPreparedCue);

Index = pCue->GetVariableIndex( "Volume" );
pCue->SetVariable( Index, (XACTVARIABLEVALUE) fVolume );

-Brian

BrianMS at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Audio / XACT...