Game Development Community

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:
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:
dl.dropbox.com/u/4350164/xact-dump.jpg

#1
11/29/2010 (8:01 am)
I figured this out.
It was a combination of wrong settings in torqueSettings.xml and a cached version of the XACT xap file.