After explaining to Robert how difficult it was getting XACT to work, he told me I should put the story up on the blog, so here it is.
Keep in mind that I had not watched the tutorial video on XACT which can be found here:
http://msdn2.microsoft.com/en-us/xna/bb245766.aspx
That would've helped out a bit. (Information that would've been useful to me yesterday, as Adam Sandler would say.)
My goal was to simply get the main menu music to play.
- I got my mp3 (Crisis.mp3).
- I used Audacity to convert it from .mp3 to .wav.
- I started XACT.
- There are Wave Banks and Sound Banks. I added Crisis.wav to the Wave Bank.
- I went into the Sound Bank and clicked "New Sound." A "Sound" is a container for events. An event is something like "Play Wave."
- I renamed my New Sound "Crisis."
- I dragged Crisis.wav from the Wave Bank into the "Crisis" Sound I just created, and it created a "Play Wave" event for me. Robert and I assume it's done like this so you could play multiple sounds at once, like "thunder.wav" and "rain.wav" could become a "Thunderstorm" sound.
- I changed some settings on "Crisis" so that it would fade out at the end.
- I created a New Cue and named it "MainMenuMusic." A Cue is basically a playlist, or a container for Sounds.
- I dragged the "Crisis" Sound into my "MainMenuMusic" Cue.
- I saved my XACT project.
This is the true end of the XACT steps, but I had to try to play the sound... - I tried to play the Cue directly from XACT, but I got an error because I didn't have the XACT Auditioning Utility running.
- I started the XACT Auditioning Utility.
- Tried playing again. Nothing. Not an even an error this time.
- Closed the XACT Auditioning Utility.
- Closed XACT.
- Started the XACT Auditioning Utility.
- Started XACT.
- Opened my XACT project.
- Played the cue, and damn if the music didn't start playing! Yes!
Back to the C# Game Project - I modified my code to be soundBank.PlayCue("MainMenuMusic").
- I built my C# game project.
- I ran the game and lo and behold, I see my new main menu and "Crisis" is playing in the background. That was cool.
- I actually go to sleep and don't think about the game for the rest of the night.
Now, if I had been smart, I would've watched the tutorial video first. If I'd done that, I could've skipped some steps, as apparently you can just drag the wave straight from the Wave Bank to the Cue section and it creates a Cue and a Sound (with a Play Wave event) for you automatically. Dang.
No comments:
Post a Comment