Skip to content

Latest commit

 

History

History
91 lines (65 loc) · 4.16 KB

ns-xaudio2-xaudio2_buffer_wma.md

File metadata and controls

91 lines (65 loc) · 4.16 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NS:xaudio2.XAUDIO2_BUFFER_WMA
XAUDIO2_BUFFER_WMA (xaudio2.h)
Used with IXAudio2SourceVoice::SubmitSourceBuffer when submitting xWMA data.
XAUDIO2_BUFFER_WMA
XAUDIO2_BUFFER_WMA structure [XAudio2 Audio Mixing APIs]
xaudio2.xaudio2_buffer_wma
xaudio2/XAUDIO2_BUFFER_WMA
xaudio2\xaudio2_buffer_wma.htm
xaudio2
T:Microsoft.directx_sdk.xaudio2.XAUDIO2_BUFFER_WMA
12/05/2018
XAUDIO2_BUFFER_WMA, XAUDIO2_BUFFER_WMA structure [XAudio2 Audio Mixing APIs], xaudio2.xaudio2_buffer_wma, xaudio2/XAUDIO2_BUFFER_WMA
xaudio2.h
Windows
Windows
XAUDIO2_BUFFER_WMA
19H1
XAUDIO2_BUFFER_WMA
xaudio2/XAUDIO2_BUFFER_WMA
c++
APIRef
kbSyntax
HeaderDef
xaudio2.h
XAUDIO2_BUFFER_WMA

XAUDIO2_BUFFER_WMA structure

-description

Used with IXAudio2SourceVoice::SubmitSourceBuffer when submitting xWMA data.

-struct-fields

-field 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.

-field 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.

XAUDIO 2.8 in Windows 8.x does not support xWMA decoding. Use Windows Media Foundation APIs to perform the decoding from WMA to PCM instead. This functionality is available in the DirectX SDK versions of XAUDIO and in XAUDIO 2.9 in Windows 10.

Platform Requirements

Windows 10 (XAudio2.9); Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

-see-also

Structures