Game Development Community

SoundGroup Not Initializing

by Anthony Farmer · in Torque X 2D · 06/02/2008 (10:14 am) · 2 replies

Hello.

The soundBank & waveBank variables of my SoundGroup come back from RegisterSoundGroup() as NULL. How do I debug this problem to see what it is SoundManager doesn't like?

I'm pretty sure it's gotta be a path issue, but nothing obvious is jumping out at me. It'd help if I could get more details about RegisterSoundGroup()'s failure to initialize.

Thanks,
ALF

#1
06/02/2008 (3:43 pm)
Weird. SoundManager.IsCreated() returns FALSE. Not sure why.
#2
06/02/2008 (4:16 pm)
Wow, THAT was obscure! And another great area where some DOCUMENTATION would be useful...

Turns out there's a "Category" property for each sound in your Wave Bank inside your XACT *.XAP file. If you use XACT to create this file from scratch as I did, the value created for this "Category" field will be "Default" unless and until you change it to "Global".

This "Global" value is REQUIRED by the TorqueX SoundManager and you must have an "" value in your TorqueSettings.xml file in order for SoundManager to be initialized properly.

Unfortunately there's no documentation ANYWHERE for SoundManager. You must already be intimate with creating XACT audio files as well, of course, but the lack of information on the SoundManager class cost me additional hours tracking this down. Turns out the "IsCreated()" function will return FALSE until you add a bank, so you can't rely upon it as any sort of debugging help when trying to determine what's wrong with your sound files.

Anyhow, hopefully this can help others trying to figure out why their sound doesn't work...

ALF