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 ?
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