Issue with XACT after switching to MonoGame version 3.6.0 (and some other audio questions)

Hey everyone

I recently switched my project over from the development version of Monogame (3.5.1.1679) to the stable release version (3.6.0.1625) and I’m having an issue with the following code:

Cue c = soundBank.GetCue(track);
c.SetVariable(“Volume”, 0.25); // <—“System.IndexOutOfRangeException”

Since switching to 3.6.0, calling “SetVariable” will trigger a System.IndexOutOfRangeException.

The code worked fine on the previous version, it’s used to independently control the audio levels of multiple tracks played at the same time to create effects like cross-fades and other transitions.

The game loads all tracks from a single XACT project containing 23 waves.

I also have some general questions about audio for a large project:

  • Is there a way to dynamically load waves from a single XACT project? Currently my project uses 700mb of process memory at runtime because it front-loads all the tracks at the start of the game.
  • Is this how XACT should be used? Should I be using a separate XACT project for each track?
  • Is there a better way of controlling a cue’s individual volume?
  • Should I even be using XACT for audio in a project that: Has a lot of music, requires multiple tracks to be played at once (with individual volume control), and aims to be cross platform (including consoles)?

I’ve been searching for ages for good information about using audio in Monogame correctly and I haven’t found anything that’s talked about these issues.

I’d really appreciate any help you could offer!
Thanks very much,
-Jamie

1 Like

Me too. Sound support documentation is either poor or out of date. I’ve just posted something similar. I can’t even find an install for Xact. If you find out what we’re meant to do these days please let me know!

1 Like