Game Development Community

BOOK: Clarification on Chapter 15

by David Horn · in Torque X 2D · 06/18/2009 (10:37 am) · 3 replies

I'm attempting to add sound to my project.

I'm using the SoundComponent of chapter 15. I added it to a dummy object in TXB.

When I ran the project, it gave me an erro on these lines of code.


_waveBank = new WaveBank(Game.Instance.Engine.SFXDevice, "data/sounds/Wave Bank.xwb");
_soundBank = new SoundBank(Game.Instance.Engine.SFXDevice, "data/sounds/Sound Bank.xsb");

It's saying that Game.Instance.Engine.SFXDevice is null. any ideas as to why that might be?

#1
06/18/2009 (12:00 pm)
Did you add AudioGlobalSettingsFile to torqueSettings.xml? This confused me a bit when I added sound.

Should be a child of the root node and look something like this:

<AudioGlobalSettingsFile>pathtosounds.xgs</AudioGlobalSettingsFile>
#2
06/18/2009 (12:14 pm)
no i didn't. thank you.
#3
06/19/2009 (6:49 am)
Also:
<EnableAudio>true</EnableAudio>