Game Development Community

Xact files can not be found using sound manager

by Raymond Ku · in Torque X 2D · 03/15/2010 (6:47 pm) · 4 replies

I'm trying to get music to run in my game

I get "Could not find file 'bin/x86/Debug/Sound Bank.xsb'."
and "Could not find file 'bin/x86/Debug/Wave Bank.xsb'."

When i look in the debug folder those two files are actually in debugdatasound
how do i get the project to look in the correct folder


in game.cs i have

SoundManager.Instance.RegisterSoundGroup(
                   "music", @"data/sound/Wave Bank.xwb", @"data/sound/Sound Bank.xsb");

      
        SoundManager.Instance.PlaySound("music", "01 Track 1");

in XACT i changed all the sounds bank files to 'global'

and in torquesettings.xml

i have
<EnableAudio>true</EnableAudio>
  <AudioGlobalSettingsFile>data/sound/music.xgs</AudioGlobalSettingsFile>

i put music.xap in my project data/sound folder

#1
03/15/2010 (8:58 pm)
I believe you have to build the xap project from within xact. I do it this way however and did not have to build the project, just drop it into the content folder.

// these are public in my Game class.
public WaveBank GameWaveBank;
public SoundBank GameSoundBank;

// I put this in BeginRun
GameWaveBank = new WaveBank(Game.Instance.Engine.SFXDevice, "data/sfx/Wave Bank.xwb");
GameSoundBank = new SoundBank(Game.Instance.Engine.SFXDevice, "data/sfx/Sound Bank.xsb");

The GameSounds.xap file is in my data\sfx folder.

I have a sound component but also anytime I need a sound I can play it anywhere by just doing:

Game.Instance.GameSoundBank.PlayCue("menuClick");

I use this in my GUI for the menu. The torquesettings.xml looks right to me.



#2
03/15/2010 (9:43 pm)
is "data/sfx" your Content folder or is "sfx" a subfolder?
I'm not sure if that matters

So does this mean that i dont have to build the project with XACT and just save the project .xap file in the content folder?

Everytime i'm adding
<AudioGlobalSettingsFile>data/sound/music.xgs</AudioGlobalSettingsFile>

in my settings.xml
my project crashes now.

Thanks so much for the reply, the help is much needed
#3
03/15/2010 (9:49 pm)
Got it working, turns out i had the streaming property turned on in the Xact wave properties. Thanks again for your help
#4
03/16/2010 (2:15 am)
If you do it the way I did you do not need to build the XACT file.