Game Development Reference
In-Depth Information
Chapter 4. Adding Sound
As you have undoubtedly noticed, the little game demo we made in the previous
chapter was a little lifeless without any sound. It goes to show how important sound
and music really are to create the full experience of a game. Music sets the mood for
the scene, and sound effects add more depth to the game world.
In this chapter we will cover the following topics:
• DirectSound versus XAudio2
• The basics of sound
• DirectSound
• XAudio2
DirectSound versus XAudio2
As with user input and graphics rendering, we have a couple of options in the sound
department as well; they are DirectSound and XAudio2 . So let's take a look at these
two.
First, there was DirectSound. When DirectSound was developed, game audio was
still fairly simple. Games would play a single .wav sound file when a given event
happened in the game world, and DirectSound allowed for improved performance if
your PC had a sound card in it by offloading sound processing from the CPU ( Central
Processing Unit ) to the sound card. This is very similar to how graphic cards handle
graphics processing, allowing the CPU to do other things.
As time went on, the processing power of both PCs and gaming consoles increased
greatly, and the simple sound model used by DirectSound was becoming insufficient
for the increasingly complex sound systems that game developers were starting to
create.
During development of the Xbox 360 gaming console, Microsoft realized that Direc-
tSound just wasn't going to cut it. So, they created XAudio to meet the increasing
demands of composers and sound designers in the video game industry. Meanwhile,
Windows Vista (codenamed Longhorn ) was also in development. The team working
on that created a new audio API called Longhorn Extensible Audio Processor .
Search WWH ::




Custom Search