Skip to main content

GetXmaDecodePositionForSample

Obtains data needed to make the decoder generate audio starting at a specified sample position relative to the beginning of the specified XBOX Media Audio (XMA) block.

Syntax

Parameters

pXmaData   _In_bytecount_(nXmaDataBytes)
Type: BYTE*
Pointer to XMA blocks. nXmaDataBytes   
Type: DWORD
Size of pXmaData, in bytes. nStreamIndex   
Type: DWORD
Stream within which to seek. nDesiredSample   
Type: DWORD
Sample sought. pnBitOffset   _Out_
Type: DWORD*
Returns the bit offset within pXmaData of the frame that contains the sample sought. pnSubFrame   _Out_
Type: DWORD*
Returns the subframe that contains the sample.

Return value

Type: HRESULT Success S_OK or error E_FAIL code.

Remarks

This function obtains data needed to make the decoder generate audio starting at a given sample position relative to the beginning of the given XMA block. This includes the bit offset of the appropriate frame and the right subframe within that frame. The data can be passed directly to the XMAPlaybackSetDecodePosition function. For more information about XMA2, see Overview of XMA2. For an overview of the audio architecture of XBOX One, see The sound of the future: The audio architecture in XBOX One.

Requirements

Header: xma2defs.h Supported platforms: XBOX One family consoles and XBOX Series consoles

See also

xma2defs
Last modified on August 20, 2026