Chapter 2: Changing the Volume, Panning, and Frequency of Stereo Sound


Overview

The American Heritage Dictionary defines cacophony as the use of harsh or discordant sounds in literary composition, as for poetic effect. This definition perhaps describes computer game sounds a bit too well, as opposed to words like harmony and melody, although it s fun to use words such as poetic effect to describe the racket that you are about to create. This chapter describes the use of a 2-D sound tool aptly named Cacophony, and then dissects its source code.

The Cacophony tool, which is included in the AVBook\bin directory, lets you examine the capabilities of DirectSound in a 2-D world. There are many games and applications that operate in a 2-D world, even if there is an appearance of 3-D on the screen. To use the 3-D capabilities of DirectSound to their best effect, it is preferable to have an underlying 3-D world to base it on. However, a game that uses artwork to create the 3-D appearance, and with what are effectively cartoon characters drawn in front of the artwork, is not based on an underlying 3-D model. This has been used to great effect, particularly with young children s games such as the Microsoft Barney and Magic Schoolbus games . For this type of application, a 2-D sound system may be all that is required.

This chapter also discusses how the utility code in the dsutil .cpp file needs to be extended to support the tool. But first, it s time to create that racket.




Fundamentals of Audio and Video Programming for Games
Fundamentals of Audio and Video Programming for Games (Pro-Developer)
ISBN: 073561945X
EAN: 2147483647
Year: 2003
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net