freds72

Hi,

I just can't figure how to set the volume of a given Cue instance.

I want one specific instance of a sound (ex: player 1 laser volume@50%, player 2 laser volume@80%).

I saw only one post giving a very light explanation, which was:

a) you should create a cue "Volume" variable in XACT (that I can do)

b) link that variable to the sound Volume (how )

c) set the volume programmatically. I suppose SetVariable("Volume",0.5) will do it once XACT is properly set up.

Thanks

Freds72



Re: Game Technologies: Audio / XACT Step by Step Cue volume sample request

Grofit

Im trying to do something similar but cant find out how to do much, to be honest ive not worked with Audio too much and the documentation seems thin at best, and i couldnt find many examples online... :(




Re: Game Technologies: Audio / XACT Step by Step Cue volume sample request

perun

You can do it like You say.
Create cue instance variable "Volume",
add RPC preset linking Sound:Volume with this variable.
Attach sounds to that preset (important!).
Then You can set cue volume by setting variable "Volume".




Re: Game Technologies: Audio / XACT Step by Step Cue volume sample request

Coridas

I am trying to create this one.

1. I created cue variable named "Volume"

2. Attached it to RPC.

3. Attached sound to RCP.

4. Trying to set value:

this._aEngine = new AudioEngine("test.xgs");

this._waveBank = new WaveBank(this._aEngine, "Wave Bank.xwb");

this._soundBank = new SoundBank(this._aEngine, "Sound Bank.xsb");

this._blow = this._soundBank.GetCue("blow");

this._blow.SetVariable("Volume",0.5f);

this._blow.Play();

and got an error:

The specified variable index is invalid.





Re: Game Technologies: Audio / XACT Step by Step Cue volume sample request

freds72

I got it, thanks

Playing a little more with XACT, I understood now the reason for the 'links'...even
if the "user experience" part could be improved!

For information, the c# code works as well. There is no need to 'prepare' the variable.

The one step not to miss is save the XAP file before compiling/launching your game!!

Regards