1 / 13

XNA Basic

XNA Basic. XACT tool. What’s format song file which XNA support?. Only .wav because it’s not compress file. Beside, you need XACT project ( XACT project) which XNA can include. Audacity. It’s a free ware. You can use it for catching song and exporting format which you want.

clive
Télécharger la présentation

XNA Basic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XNA Basic XACT tool

  2. What’s format song file which XNA support? • Only .wav because it’s not compress file. • Beside, you need XACT project ( XACT project) which XNA can include.

  3. Audacity • It’s a free ware. You can use it for catching songand exporting format which you want. • Download : http://audacity.sourceforge.net

  4. XACT tool • XACT tool is concurrence being installed with XNA.

  5. Starting with XACT • How do we start? • First .wav file should be in content folder. • Second create new project from file menu. • Third create Wave Bank from Wave Bank menu. • Forth drag drop .wav file into Wave Bank windows or choose insert file from Wave Bank menu.

  6. Starting with XACT • Fifth drag drop .wav file from Wave Bank window into Sound Bank up window. • Sixth drag drop .wav file from Sound Bank up window into down window for creating Cue. • Seventh build and save project. • When build project, it will create .xgs file(Audio Engine), .xwb file(Wave Bank), .xsb(Sound Bank) which we will talk late.

  7. Why must we have Wave Bank and Sound Bank? • Wave Bank is a material for creating Sound Bank. • Two Wave Bank can create many Sound Bank. • But we won’t talk detail about it because it’s job of sound engineer. You can find more detail in wiki.

  8. Audio Engine, Wave Bank, Sound Bank • Audio Engine tell XNA about setting in XACT project. • Wave Bank tell XNA about its settingand which file hold data. • Sound Bank is the same Wave Bank doing.

  9. Include XACT project. • Right click at content in Solution Explorer and choose exiting item and find .xap file (XACT project) • Don’t forget .wav file must be in content folder. • It’s good at everything being in new folder. • Here I’ll create folder Sound.

  10. Sample Code for loading XACT AudioEngine audio; WaveBank waves; SoundBank sounds; protected override void LoadContent() { audio = new AudioEngine(@”Content\Sound\SampleSound.xgs”) waves = new WaveBank(audio,@”Content\Sound\Wave Bank.xwb”) sounds = new Sound(audio,@”Content\Sound\SoundBank.xsb”) }

  11. protected override void update() { sounds.PlayCue(“scream”); } Cue name in your project

  12. Or maybe you may use cue instead of Sound Bank. Cue SoundCue; SoundCue = sounds.GetCue(“scream”); You can use SoundCue.IsPlaying; SoundCue.IsPaused; SoundCue.Play(); SoundCue.Pause(); SoundCue.Resume();

  13. Let’s practice more • Use your project from getting input, Make it have sound effect.

More Related