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

# 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](https://docs.xbox.com/build/console-features/audio/overviews/xbox-one-audio-architecture.md).

## Requirements

**Header:** xma2defs.h

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

## See also

[Audio Overview](https://docs.xbox.com/build/console-features/audio/overviews/audio.md)

[xma2defs](https://docs.xbox.com/reference/audio/xma2defs/xma2defs_members.md)


## Related topics

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