xaudio2 - compressed wave from wavebank

Last post 04-01-2008, 4:38 PM by perun. 2 replies.
Sort Posts: Previous Next
  •  03-28-2008, 12:38 PM

    xaudio2 - compressed wave from wavebank

    Hi,

    How to play compressed wave (adpcm or xwma) from wavebank?
    wave format in WAVEBANKENTRY describe uncompressed data, but during voice (IXAudio2::CreateSourceVoice) creation I need proper WAVEFORMATEX (xaudio2 outputs error messages). Everything is ok if I use wavebank with uncompressed data.


  •  04-01-2008, 12:49 PM

    Re: xaudio2 - compressed wave from wavebank

    Hi, perun.  The only information that XAudio2 needs/uses to play back audio is the audio format (expressed as a WAVEFORMATEX-based structure) and a pointer to the raw audio data.  Therefore, XAudio2 does not operate on XACT wavebanks directly.  However, if you have any kind of audio container file that includes multiple waves, you can certainly use it - just read out the appropriate piece of audio data yourself and set up a matching WAVEFORMATEX.  In the WAVEBANKENTRY case, it's easy enough to map from its fields to the basic WAVEFORMATEX fields.

    Hope that helps,
    Dugan


    Dugan Porter [MS]
    Game Audio Team
  •  04-01-2008, 4:38 PM

    Re: xaudio2 - compressed wave from wavebank

    I use XACT wavebanks as audio containers, which have WAVEBANKMINIWAVEFORMAT for each WAVEBANKENTRY. It suffices for PCM data, but to play ADPCM data xaudio2 expects  ADPCMFORMAT  with additional information like samples per block and array of coefficients. I used parameters suggested by xaudio2 through debug output and it works. I suppose that such information exist in .xwb file because XACT manages to play it, or extended parameters are constant and hard-coded in XACT wavebanks reader.
View as RSS news feed in XML
©2007 Microsoft Corporation. All rights reserved. Privacy Statement Terms of Use Code of Conduct Feedback