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

# XMA2Defs

> XMA2Defs

XMA2Defs APIs

## Functions

| Function | Description |
| - | - |
| [GetLastXmaFrameBitPosition](https://docs.xbox.com/reference/audio/xma2defs/functions/getlastxmaframebitposition.md) | Calculates the bit offset of the last complete frame in an XMA block or a set of blocks. |
| [GetStandardChannelMaskFromXmaMask](https://docs.xbox.com/reference/audio/xma2defs/functions/getstandardchannelmaskfromxmamask.md) | Converts between WAVEFORMATEXTENSIBLE channel masks and XMA channel masks. |
| [GetXmaBlockContainingSample](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmablockcontainingsample.md) | Use a specified seek table to find the XMA block that contains a specified decoded sample. |
| [GetXmaChannelMaskFromStandardMask](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmachannelmaskfromstandardmask.md) | Converts between WAVEFORMATEXTENSIBLE channel masks and XMA channel masks. |
| [GetXmaDecodePositionForSample](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmadecodepositionforsample.md) | Obtains the information needed to make the decoder generate audio starting at a specified sample position relative to the beginning of the specified XMA block. |
| [GetXmaFrameBitPosition](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmaframebitposition.md) | Calculates the bit offset of a specified frame within an XMA block or a set of blocks. |
| [GetXmaFrameLengthInBits](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmaframelengthinbits.md) | Reads a specified frame's LengthInBits field. |
| [GetXmaPacketFirstFrameOffsetInBits](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketfirstframeoffsetinbits.md) | Helper function for the XMA2PACKET structure. Returns the first frame offset. |
| [GetXmaPacketFrameCount](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketframecount.md) | Helper function for the XMA2PACKET structure. Returns the packet frame count. |
| [GetXmaPacketMetadata](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketmetadata.md) | Helper function for the XMA2PACKET structure. |
| [GetXmaPacketSkipCount](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketskipcount.md) | Helper function for the XMA2PACKET structure. Returns the packets from other streams to skip. |
| [GetXmaSampleRate](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmasamplerate.md) | Obtains the legal XMA sample rate (24, 32, 44.1, or 48 KHz) that corresponds to a generic sample rate. |
| [LocalizeXma2Format](https://docs.xbox.com/reference/audio/xma2defs/functions/localizexma2format.md) | Modifies an XMA2WAVEFORMATEX structure in place to comply with the current platform's byte-ordering rules (little-endian or big-endian). |

## Structures

| Structure | Description |
| - | - |
| [XMA2PACKET](https://docs.xbox.com/reference/audio/xma2defs/structs/xma2packet.md) | XMA packet structure (in big-endian form). |
| [XMA2STREAMFORMAT](https://docs.xbox.com/reference/audio/xma2defs/structs/xma2streamformat.md) | Structure used in XMA2WAVEFORMAT for per-stream data. |
| [XMA2WAVEFORMAT](https://docs.xbox.com/reference/audio/xma2defs/structs/xma2waveformat.md) | Legacy XMA2 format structure in big-endian byte order. |
| [XMA2WAVEFORMATEX](https://docs.xbox.com/reference/audio/xma2defs/structs/xma2waveformatex.md) | The recommended way to express format information for XMA2 files. |
| [XMASTREAMFORMAT](https://docs.xbox.com/reference/audio/xma2defs/structs/xmastreamformat.md) | Used in XMAWAVEFORMAT for per-stream data. |
| [XMAWAVEFORMAT](https://docs.xbox.com/reference/audio/xma2defs/structs/xmawaveformat.md) | Structure of the legacy XMA1 format. |

## Conceptual documentation

* [XMA2 overview](https://docs.xbox.com/build/console-features/audio/overviews/xma2-overview.md)

## See also

[Audio API reference](https://docs.xbox.com/reference/audio/gc-reference-audio-toc.md)


## Related topics

- [Overview of XMA2](https://docs.xbox.com/build/console-features/audio/overviews/xma2-overview.md)
- [Audio API reference](https://docs.xbox.com/reference/audio/gc-reference-audio-toc.md)
- [XMA2WAVEFORMATEX](https://docs.xbox.com/reference/audio/xma2defs/structs/xma2waveformatex.md)
- [XMA2PACKET](https://docs.xbox.com/reference/audio/xma2defs/structs/xma2packet.md)
- [XMA2STREAMFORMAT](https://docs.xbox.com/reference/audio/xma2defs/structs/xma2streamformat.md)
