Music Volume
by JohnT · in Torque X 2D · 06/25/2008 (8:36 am) · 1 replies
Anyone know how to adjust the volume of music playing during gameplay? I looked through the source and did not find anything. I even tried calling the XNA Audio engine directly like this:
AudioEngine myAudio = Game.Instance.Engine.SFXDevice;
AudioCategory myCategory = myAudio.GetCategory("Music");
myCategory.SetVolume(0.5f);
myAudio.Update();
Still no luck!
AudioEngine myAudio = Game.Instance.Engine.SFXDevice;
AudioCategory myCategory = myAudio.GetCategory("Music");
myCategory.SetVolume(0.5f);
myAudio.Update();
Still no luck!
About the author
Torque Owner Scott Goodwin
_musicAudio = MyGame.Instance.Engine.SFXDevice.GetCategory("Music"); _musicAudio.SetVolume(value);(with "AudioCategory _musicAudio;" and "value" a float between 0 an 1)
This only affects sounds in the music category. Double check in XACT that the sound you are trying to control is actually in the Music category.
Otherwise that's puzzling ...