1

I am using XNA to develop a game which requires both sound effects and music. I'm trying to figure out how to implement the sound engine. Microsoft provides the ability to use the Content Pipeline to load and play audio. However, I also seen people use Xact to do the same thing. My question is, whats the difference and what would be the better approach to making a sound engine?

Dave
  • 7,283
  • 12
  • 55
  • 101
  • It really depends on what you are building. You are not really (or at least shouldn't be) building a "sound engine" because that's what XACT and the Content Pipeline's audio stuff already are. Personally I recommend going with the easier Content Pipeline, and switching to XACT if you later find that you need it. – Andrew Russell Sep 25 '10 at 04:26
  • I am in a group and my responsibility is Engine programming. I am simply writing a wrapper class so that I can A) Provide ease of use and B) Have the ability to have multiple sound engines. I just wanted to know the pros/cons and figure out if MS intended for me to use the Content Pipeline or if everything could be done in Xact. – Dave Sep 25 '10 at 09:14

1 Answers1

4

Xact is feature rich but complex to use. It was originally the only way to play sound but people wanted something simpler so Microsoft added the content pipeline method.

Use the Content Pipeline if you want:

  • To play a sound (2d or 3d)
  • To not have to invest a lot of time learning an audio framework

Use Xact if you want:

  • Categories of sounds that can be interdependently controlled, like mute game sounds but not menu sounds
  • Real time advanced control over sound pitch, volume. For things like turrets spinning up, cars accelerating etc.
  • To have multiple varieties of a single sound effect like a seven different pain sounds and have Xact choose which one to play.
  • To have a sound play with slightly different pitch, volume, filter or 3d pan every time it is played. This is really good for bullets and repetitive things like that. There is nothing that says fake computer simulation like a repeating sound with no variance.
  • To allow a game designer or sound designer full control to edit and change sounds without touching the code.
  • To have sound banks (collections of sound) that you can load or unload as a group, which can use different compression settings and can be in memory or streaming.
  • To mix the volume, pitch and priority of sounds in an editor.
  • To apply filtering to a sound.
  • To control whether the sound is looping or not.
  • To use DSP Effects

One of my favourite things about Xact is editing and previewing of sound functions in editor. For example a volume fade on a turret overheat sound. With XACT you can sit down with the sound designer, even if he's not a technical guy and edit the control curves until he's happy with the sound. Once you've set it up it's really easy to change later on. In this example image here a turret is overheated. At the end of the overheat cycle the hissing steam noise volume is reduced, but because it's a curve I have a lot of control over how the sound fades out. I've used this with a beam weapon as well, dropping the frequency according to a curve as it runs out of ammo.

Empyrean
  • 1,823
  • 12
  • 10