Games for Windows and the DirectX SDK blog

Technical tips, tricks, and news about game development for Microsoft platforms including desktop, Xbox, and UWP

Project maintained by walbourn Hosted on GitHub Pages — Theme by mattgraham
Home | Posts by Tag | Posts by Month

DirectX Tool Kit for Audio

audio, codeplex, winphone, xbox one

Originally posted to Chuck Walbourn's Blog on MSDN,

The December 2013 release of DirectXTK is now available on CodePlexGitHub, and includes a C++ implementation of the XNA Game Studio’s low-level audio framework using XAudio2 and X3DAudio.

  • AudioEngine - This class represents an XAudio2 audio graph, device, and mastering voice; similar to XNA's AudioEngine.
  • SoundEffect - A container class for sound resources which can be loaded from ``.wav`` files similar to XNA's SoundEffect.
  • SoundEffectInstance - Provides a single playing, paused, or stopped instance of a sound similar to XNA's SoundEffectInstance.
  • DynamicSoundEffectInstance - SoundEffectInstance where the application provides the audio data on demand similar to XNA's DynamicSoundEffectInstance.
  • WaveBank - A container class for sound resources packaged into an XACT-style ``.xwb`` wave bank, similar to XNA's WaveBank but with support for directly playing one-shots and creating SoundEffectInstances that refer to entries in the wave bank.
  • AudioListener, AudioEmitter - Utility classes used with SoundEffectInstance::Apply3D.

DirectXTK for Audio uses XAudio 2.8 for Windows Store apps for Windows 8.1, Windows Store apps for Windows 8.0, Windows phone 8, and Xbox One*. The VS projects for these platforms all include the graphics and audio components.

When building Win32 desktop applications, you can either make use of XAudio 2.8 if targeting Windows 8.0 or later, or you can make use of XAudio 2.7 with the legacy DirectX SDK (June 2010) to target Windows Vista, Windows 7, or later. There is one VS project for the graphics component, another for the Windows 8.x version of the audio components, and another for the down-level version that requires the legacy DirectX SDK to build.

Windows 7 Update: There is now a NuGet package for using XAudio 2.9 down-level on Windows 7 Service Pack 1, Windows 8.0, and Windows 8.1. See Microsoft Docs for details.

The DirectXTK package also includes a new command-line tool, XWBTool, which can be used to build XACT-style wave banks for more efficient management of audio data. DirectXTK for Audio does not make use of the legacy XACT Engine, XACT Cue, or XACT SoundBank. It only uses .xwb wave banks as a method for packing .wav data. The WaveBank class can use .xwb wave banks built with XWBTool or the legacy XACTBLD tool.

More detailed documentation, full release notes, and other information can be found on the DirectXTK CodePlexGitHub site.

Related: XAudio2 and Windows 8, DirectXTK (March 2012), DirectXTK Update (Jan 2013), CodePlex VS 2013 Refresh

* = The December 2013 releases of DirectXTK and DirectXTex on CodePlex fully support development for both Xbox One ADK and Xbox One XDK developers. See ID@Xbox.

Update: The January 2014 release of DirectXTK includes voice management and optional mastering volume limiter. Refreshed all the Simple Sample releases to include DirectXTK for Audio demo. DirectX Tool Kit is also hosted on GitHub

Windows 10: When building with the Windows 10 SDK, DirectX Tool Kit for Audio uses XAudio 2.9.