Add a voice using xact-Summary

Source: Internet
Author: User
Summary

In this chapter, you learned the sound effects in xNa. Whether you like it or not, you must use xact. Xact enables you to play sound effects and music on the Xbox 360 and Windows platforms.

The following are the key points you have learned in this chapter:

  • Xact is the only way to use xNa to play a sound on Xbox 360.

  • The xact tool may be annoying at first, but once you get used to it, you can enjoy new and cool features. For exampleCodeTo enable fade-in and fade-out, it is easier to set in xact.

  • Xact does not support MP3, Ogg, ACC, and other custom compression formats. Only two formats are supported: ADPCM on Windows and xma on Xbox 360.

  • Xma is a good compression format for Xbox 360, but ADPCM is not really useful. If you have time and want to use smaller audio files on Windows, you can implement directaudiovideoplayback to your engine or use other external sound engines from the DirectX SDK.
  • I recommend 75% quality for xma, and ADPCM recommends 128 or 256 samples for each block. The Windows version may be twice the version 360 because the ADPCM encoding compression rate is poor.

  • Makes the sound class easy to use and can be used anywhere.

  • Use sound enumeration to quickly obtain and play available sound cue.

  • Compile helper classes for your frequently called code.

  • In xact, the custom cue variable is first set and then imported to xNa code. The setvariable method can modify the cue instance variables.

The next chapter discusses the input class keyboard, mouse, and Xbox 360 handle, which is already in the graphics engine, but all the methods are not discussed in detail. In addition, you will understand the menu system and user interface code. For example, the user interface code automatically plays a sound every time you move or click the control. For custom controls, you must perform all inspection and processing on your own. You can also learn about xNa shooter games, which will be completed in Chapter 11th.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.