首页 > Computer > XNA > How To: Specify Background Music Using XACT
2009
02-22

How To: Specify Background Music Using XACT

Demonstrates how to specify sound (.WAV) files as background music. Specifying background music enables the XNA Framework to override the background music with the user’s music choice, without interrupting other game sounds such as sound effects. This is accomplished by setting the sound bank category to music in XACT.

Dd231916.note(en-US,XNAGameStudio.30).gifNote
Streaming allows for the .WAV file to be gradually read from the disk rather than loaded into memory all at once. Background music files may be larger than files containing other game sounds; therefore, typically they are streamed. In XACT, you need to create and use a streaming WaveBank to stream background music. To learn about streaming, see How To: Stream a Sound.

Specifying Background Music in Your Game

This procedure assumes you are have already created an XACT project.

To specify background music in your game

  1. To open the XACT project, choose the File menu, and then click Open Project.

  2. Browse to your project location, and click Open.

    The project will load.

  3. Double-click the sound bank that contains the background music.

    This highlights the sound bank in the left navigation tree, and displays the sound bank properties pane.

  4. Click the sound you wish to designate as background music.

    This displays the properties pane, and then shows the category options for the sound.

  5. Select music in the category drop down box, and save the project.

最后编辑:
作者:wy182000
这个作者貌似有点懒,什么都没有留下。

留下一个回复