Sound trouble [SOVLED]
by Thomas Vestergaard Nielsen · in Torque X 2D · 11/25/2010 (7:36 am) · 1 replies
Hey guys
I'm having some trouble playing sounds. Well, I can get it to play sounds, but not the way I want to.
This works:
This does NOT work
I get a NullReferenceException on the GetCategory line.
Here is how XACT is setup:

I'm having some trouble playing sounds. Well, I can get it to play sounds, but not the way I want to.
This works:
var engine = new AudioEngine(@"dataMusicMelvinMusic.xgs");
var soundBank = new SoundBank(engine, @"data/Music/Sound Bank.xsb");
var waveBank = new WaveBank(engine, @"data/Music/Wave Bank.xwb");
// Play the sound.
soundBank.PlayCue("theanalogway2");This does NOT work
var SoundGroup = SoundManager.Instance.RegisterSoundGroup("Music", @"data/Music/Wave Bank.xwb", @"data/Music/Sound Bank.xsb");
AudioCategory _music = Game.Instance.Engine.SFXDevice.GetCategory("Music");
Game.Instance.SoundGroup.PlaySound("theanalogway2");I get a NullReferenceException on the GetCategory line.
Here is how XACT is setup:

About the author
+10 years of programming experience. 6+ years in C#. 0 years in torque :)
Torque Owner Thomas Vestergaard Nielsen
It was a combination of wrong settings in torqueSettings.xml and a cached version of the XACT xap file.