Once I’d worked out that the clicking noises I was getting in Retrofit:Overload were not clipping but were caused by stopping the sounds, I expected it to be easy to fix in XACT. It was, really, but only after some puzzling over the MSDN docs and a false start or two.

To save others similar confusion, here’s a step by step guide to adding a release curve to a sound in XACT…

  • In XACT, create a new RPC Preset. This brings up the RPC editor.
  • Set Variable to ReleaseTime.
  • Set Object to Track 1.
  • Set Parameter to Volume.
  • Now draw your release curve. To just prevent clicks, rather than create an audible fade out, it can be really short. I used half a second but it could probably be shorter. So at time 0 Volume is 0dB, and at 0.5 seconds Volume is -96dB.
  • Give your RPC an informative name, E.g. “ReleaseRPC”.
  • Now find the relevant sounds (not cues) in your Sound Bank and attach the RPC. (For single sounds you can do this on the sound’s right-click menu. Alternatively you can drag sounds onto your RPC entry in the project tree and this works with multiple sounds at once.)
  • Thats it for XACT. Save your project :-)

To use the release when the sound is stopped, it must be stopped  “as authored”.

  • With XNA: cue.Stop(AudioStopOptions.AsAuthored);
  • With DirectX: cue->Stop(0);

There’s no need to create a new XACT Variable to drive the RPC. The ReleaseTime variable is automatically available on each playing cue.

The MSDN entry on XACT envelope parameters has much more to say about this. It does actually make sense if you don’t let the jargon distract you.