1 min read

XACT Sound Loops

Overview

This tutorial will show you how to do sound loops in XACT. Probably this would be the most useful for background music, but I’m sure you can find other uses for it as well. Before going through this tutorial, it would probably help to go through the tutorials that teach you the basics of playing sound in XNA using XACT (Using XACT and Playing Sound) if you haven’t already.

XACT Sound Loops

Setting up a sound to loop repeatedly, or to loop forever, is not all that hard. Open up your project in XACT. In the Sound Bank window, select the sound that you want to repeat.

Screenshot 1

On the panel on the left side, you should see a control that looks like the image below:

Screenshot 2

In the ‘Looping’ group, type in either the number of times that you want the sound to repeat, or check the ‘Infinite’ box to make the sound play forever.

After you save your project again, you should now be able to run your game again and see that the desired sound will play repeatedly, once you start playing it.