XNA Creators Club Online
Page 1 of 1 (8 items)
Sort Posts: Previous Next

xWMA and XACT3

Last post 05-05-2008 11:12 AM by kamenkova. 7 replies.
  • 04-17-2008 9:02 AM

    xWMA and XACT3

    I would like to use the xWMA format for our large sound files.
    I'm asking myself how to implement the converted files into our XACT project.
    All I could find in the documentation is:

    xWMA Decoding in XAudio2 and XACT3

    Both XAudio2 and XACT3 now support xWMA> decoding in software on both Xbox
    360 and Windows. xWMA uses the WMA bitstream format in a light-weight
    wrapper and can provide 1.5X the compression compared with XMA at similar
    quality. xWMA is very useful for types of content, such as dialog or music,
    for which you can afford a small CPU hit to achieve much greater
    compression. A quality setting similar to XMA's allows you to increase or
    decrease compression to adjust sound performance.

    This SDK also includes WMAEncode, a command-line tool that allows you to
    create xWMA content for use in both XAudio2 and XACT3.

    I must be missing something.

  • 04-17-2008 11:37 AM In reply to

    Re: xWMA and XACT3

    Currently, XNA Framework only supports XACT2, which only supports ADPCM for Windows, and only supports XMA for Xbox (apart from uncompressed formats).
    There has been some hopes that GS 3.0 will use XACT3, which allows you more options in compression, but the earliest that would be released is by Christmas this year, and we don't know for sure whether that will be in.
    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 04-17-2008 11:57 AM In reply to

    Re: xWMA and XACT3

    Hmm, ok, which means ... I can't use the xwma compression at the moment!?
    The XACT v3.0 at least now allows for a wma compression.

  • 04-17-2008 2:14 PM In reply to

    Re: xWMA and XACT3

    I am a little confused now: is the original question realted to the native XACT stuff (as this being the native DX/C++ Audio forum) or is it just a "misplaced" XNA FX question?
    We are boki. The rest is known.
    The not so known part of the rest: It is Björn or Bjoern, but never Bjorn.
    Björn does not stalk John Sedlak
  • 04-17-2008 5:44 PM In reply to

    Re: xWMA and XACT3

    Sorry, I mistook the forum.

    If you're using XACT 3 from the DX SDK, then there is a "WMA" option for compression format when setting up your compression preset. I presume that using this setting actually puts the data in xWMA format in the wave bank. Note that xWMA has to do with the container/framing, not the actual bit stream.

    To play xWMA on XAudio2, use an XMAWAVEFORMAT structure instead of the WAVEFORMATEX when creating the voice. It's defined in xma2defs.h, but apparently not documented in the SDK docs. Below is an excerpt:

    /***************************************************************************
    * XMA format structures
    ***************************************************************************/


    // The currently recommended way to express format information for XMA2 files
    // is the XMAWAVEFORMATEX structure. This structure is fully compliant with
    // the WAVEFORMATEX standard and contains all the information needed to parse
    // and manage XMA2 files in a compact way.

    #define WAVE_FORMAT_XMA2 0x166

    typedef struct XMA2WAVEFORMATEX
    {
    WAVEFORMATEX wfx;
    // Meaning of the WAVEFORMATEX fields here:
    // wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2
    // nChannels; // Channel count of the decoded audio
    // nSamplesPerSec; // Sample rate of the decoded audio
    // nAvgBytesPerSec; // Used internally by the XMA encoder
    // nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8
    // wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA
    // cbSize; // Size in bytes of the rest of this structure (34)

    WORD NumStreams; // Number of audio streams (1 or 2 channels each)
    DWORD ChannelMask; // Spatial positions of the channels in this file,
    // stored as SPEAKER_xxx values (see audiodefs.h)
    DWORD SamplesEncoded; // Total number of PCM samples the file decodes to
    DWORD BytesPerBlock; // XMA block size (but the last one may be shorter)
    DWORD PlayBegin; // First valid sample in the decoded audio
    DWORD PlayLength; // Length of the valid part of the decoded audio
    DWORD LoopBegin; // Beginning of the loop region in decoded sample terms
    DWORD LoopLength; // Length of the loop region in decoded sample terms
    BYTE LoopCount; // Number of loops; 0 = no looping, 255 == infinite
    BYTE EncoderVersion; // Version of XMA encoder that generated the file
    WORD BlockCount; // XMA blocks in file (and entries in its seek table)
    } XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX;


    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 04-18-2008 5:27 AM In reply to

    Re: xWMA and XACT3

    jwatte:
    I presume that using this setting actually puts the data in xWMA format in the wave bank.

    Ok, but how can we be sure?

  • 04-18-2008 11:43 AM In reply to

    Re: xWMA and XACT3

    Tom Wolle:

    Ok, but how can we be sure?



    Because it works on both Xbox and Windows?

    Note the description: wWMA is the same bit stream as WMA, just with different framing.
    Jon Watte, Direct3D MVP kW X-port 3ds Max .X exporter kW Animation source code
  • 05-05-2008 11:12 AM In reply to

    Re: xWMA and XACT3

    jwatte:
    To play xWMA on XAudio2, use an XMAWAVEFORMAT structure instead of the WAVEFORMATEX when creating the voice.


    Can you help me with a simlpe example, whitch playing WMA on XAudio2?

    Thanks.
Page 1 of 1 (8 items) Previous Next