Sound

Introduction

The DirectX SDK has, in the past, supported two APIs DirectSound and DirectMusic for the handling of sound in games. However recently Microsoft have been introducing Xbox APIs into the PC version of DirectX so XACT has been added. DirectMusic will be removed in the November 2007 SDK release. DirectSound is also being removed in the November 2007 SDK release and is being replaced by a new low level sound API called XAudio2.

To summarise:  DirectSound and DirectMusic are deprecated and replaced by XACT and XAudio2 APIs.

XACT

XACT provides a complete audio creation tool and API for getting sounds into games and playing them back. XACT is primarily a high level content driven API and therefore does not replace DirectSound. Recently Microsoft have added some lower code driven API elements to XACT but it is still not a suitable replacement for DirectSound. See the XACT Notes

DirectSound Information

Note: from the November 2007 release of the DirectX SDK DirectSound will be removed. It is being replaced by XAudio2.

The DirectSound API allows you to play back sound effects in your game. Unlike DirectShow you can play multiple sounds at once. You can also:

  • use hardware controlled buffers for extra speed
  • position sounds in 3D space
  • add effects to sound e.g. reverb, echo
  • record sounds

See the DirectSound notes:

Other Sound Notes

Notes on how to load WAVE (.wav) data:

Further Reading

There are other APIs available for adding sounds to your game. Just because you might use Direct3D for graphics it does not mean you cannot mix it with other APIs. Two popular ones are:

  • OpenAL - free open source and cross platform audio library
  • FMOD - another free cross platform audio library



© 2004-2016 Keith Ditchburn