Quantcast
Channel: directxtk Wiki Rss Feed
Viewing all articles
Browse latest Browse all 874

Updated Wiki: XWBTool

$
0
0
The XWBTool is a command-line utility for for building XACT-style wave banks for use with the DirectXTK for Audio Wave Bank class.

See Audio, WaveBank

Example usage

xwbtool -o wavebank.xwb Sound.wav Explosion.wav Music.wav

Options

-s
Creates as streaming wave bank, otherwise defaults to in-memory wave bank
-o <filename>
Sets output filename for .xwb file. Otherwise, it defaults to the same base name as the first input .wav file
-h <h-filename>
Generates a C/C++ header file with #defines for each of the sounds in the bank matched to their index
-n
Disables the default warning of overwriting an existing .xwb file
-c / -nc
Forces creation or prevents use of compact wave banks. By default, it will try to use a compact wave bank if possible.
-f
Includes entry friendly name strings in the wave bank for use with 'string' based versions of WaveBank::Play() and WaveBank::CreateInstance() rather than index-based versions.

Wave bank types

XACT-style wave banks come in two forms: in-memory and streaming. The in-memory form is intended to have the whole wave bank loaded into memory at once for use. This allows wave banks to be organized by use and efficiently loaded with minimal memory fragmentation. For use with SoundEffectInstance and as one-shots with WaveBank's Play method, use the in-memory form.

The streaming form is laid out such that each individual wave in the bank is aligned to 4K boundaries for use with async I/O. Only the metadata is loaded into memory, with all the wave data read on-demand from the remainder of the file. See the XAudio2AsyncStream sample code on MSDN Code Gallery for an example of using the streaming wave bank form. http://code.msdn.microsoft.com/XAudio2-Win32-Samples-024b3933

Compact wave banks

XACT-style wave banks store meta-data in two forms: standard and compact. In the standard form, the wave-bank metadata is written using a 24-byte record per wave in the bank. In the compact form, they only requires 4-bytes per record. The Compact form requires that all waves in the bank have the same format, and the overall size of the bank's wave data must be less than 8,388,604 (~8 MB) for in-memory wave banks, or 268,433,408 bytes (~256 MBs) for streaming wave banks.

XWBTool will attempt to create a compact wave bank if the input .wav files allow, otherwise it will use the standard form. The -c and -nc commandline options override this behavior.

XACT3

The XACT3 GUI and/or the XACTBLD command-line tool in the legacy DirectX SDK (DirectX SDK) can be used to build .xwb wave banks that are compatible with DirectXTK for Audio if built for Windows rather than Xbox 360. XWBTool is just a simplified way to build them.

http://blogs.msdn.com/b/chuckw/archive/2011/12/09/known-issue-directx-sdk-june-2010-setup-and-the-s1023-error.aspx
http://support.microsoft.com/kb/2728613
http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx
http://blogs.msdn.com/b/chuckw/archive/2012/03/22/where-is-the-directx-sdk.aspx
http://blogs.msdn.com/b/chuckw/archive/2013/07/01/where-is-the-directx-sdk-2013-edition.aspx

With respect to compact wave banks, the legacy XACT3 ENGINE only supports 'streaming' compact wave banks not 'in-memory' compact wave banks. The XACT3 GUI / XACTBLD toolset will therefore only create 'standard' in-memory wave banks. There is also a known bug in the DirectX SDK (June 2010) version of the XACT3 GUI / XACTBLD toolsets that will not attempt to create a compact wave bank if the wave data size exceeds 2,097,151 (~2 MB).

Content support

XACT-style wave banks support 8-bit and 16-bit PCM (i.e. not 32-bit IEEE float PCM), MS-ADPCM, xWMA, and XMA2 content.

To compress to MS-ADPCM .wav files, use adpcmencode.exe from the Windows 8.x SDK, Xbox One ADK, Xbox One XDK, or legacy DirectX SDK.

To compress to xWMA .wav files, use xwmaencode.exe from the Xbox One ADK, Xbox One XDK, or legacy DirectX SDK.

To compress to XMA2 .wav files, use xma2encode.exe from the Xbox One XDK.

Note

This tool is also included in the XAudio2 Win32 desktop samples package.

http://code.msdn.microsoft.com/XAudio2-Win32-Samples-024b3933

Viewing all articles
Browse latest Browse all 874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>