> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetXmaFrameBitPosition

> GetXmaFrameBitPosition

# GetXmaFrameBitPosition

Calculates the bit offset of a specified frame within an XBOX Media Audio (XMA) block or within a set of blocks.

## Syntax

```cpp theme={null}
DWORD GetXmaFrameBitPosition(  
         const BYTE* pXmaData,  
         DWORD nXmaDataBytes,  
         DWORD nStreamIndex,  
         DWORD nDesiredFrame  
)  
```

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

*nDesiredFrame*   \
Type: DWORD

Frame sought.

### Return value

Type: DWORD

Returns the bit position; on failure, returns 0.

## Remarks

This function calculates the bit offset of a given frame within an XMA block or set of blocks.  It returns 0 with a failure. The pointer to the XMA block(s) uses the `pXmadata` parameter.  For an overview of the audio architecture of XBOX One, see **The sound of the future**: [The audio architecture in XBOX One](/build/console-features/audio/overviews/xbox-one-audio-architecture).

## Requirements

**Header:** xma2defs.h

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

[Audio Overview](/build/console-features/audio/overviews/audio)

[xma2defs](/reference/audio/xma2defs/xma2defs_members)


## Related topics

- [XMA2Defs](/reference/audio/xma2defs/xma2defs_members.md)
- [GetLastXmaFrameBitPosition](/reference/audio/xma2defs/functions/getlastxmaframebitposition.md)
- [GetXmaFrameLengthInBits](/reference/audio/xma2defs/functions/getxmaframelengthinbits.md)
- [GetXmaPacketFirstFrameOffsetInBits](/reference/audio/xma2defs/functions/getxmapacketfirstframeoffsetinbits.md)
- [GetXmaDecodePositionForSample](/reference/audio/xma2defs/functions/getxmadecodepositionforsample.md)
