XAUDIO2_BUFFER_WMA Structure

Used with IXAudio2SourceVoice::SubmitSourceBuffer when submitting xWMA data.

Syntax

typedef struct XAUDIO2_BUFFER_WMA {
    UINT32 *pDecodedPacketCumulativeBytes;
    UINT32 PacketCount;
} XAUDIO2_BUFFER_WMA;  

Members

pDecodedPacketCumulativeBytes
Decoded packet cumulative data size array, each element is the number of bytes accumulated after the corresponding xWMA packet is decoded in order, must have PacketCount elements.

PacketCount
Number of xWMA packets submitted, must be >= 1 and divide evenly into the respective XAUDIO2_BUFFER.AudioBytes value passed to IXAudio2SourceVoice::SubmitSourceBuffer.

Remarks

When streaming an xWMA file a few packets at a time, XAUDIO2_END_OF_STREAM should be specified on the last packet. Alternatively, the application may call IXAudio2SourceVoice::Discontinuity after submitting the last packet.

In addition, when streaming an xWMA file a few packets at a time, the application should subtract pDecodedPacketCumulativeBytes[PacketCount-1] of the previous packet from all the entries of the currently submitted packet.

The members of XAUDIO2_BUFFER_WMA correspond to values contained in the ‘dpds’ RIFF chunk of the xWMA file being played. PacketCount will correspond to the size in UINT32s of the chunk. pDecodedPacketCumulativeBytes will correspond to a UINT32 buffer containing the contents of the chunk. The contents of the buffer will need to be byte swapped when loading the buffer on Xbox 360.

Memory allocated to hold a XAUDIO2_BUFFER or XAUDIO2_BUFFER_WMA structure can be freed as soon as the IXAudio2SourceVoice::SubmitSourceBuffer call it is passed to returns. The data the structure points to (pAudioData and pDecodedPacketCumulativeBytes, respectively) can’t be freed until the buffer completes (as signaled by the IXAudio2VoiceCallback::OnBufferEnd callback) or the voice is stopped and destroyed.

Requirements

Header: Declared in xaudio2.h.

Library: Use xaudio2.lib.