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

# XMA2Defs

> XMA2Defs

# XMA2Defs

XMA2Defs APIs

## Functions

| Function                                                                                                     | Description                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [GetLastXmaFrameBitPosition](/reference/audio/xma2defs/functions/getlastxmaframebitposition)                 | Calculates the bit offset of the last complete frame in an XMA block or a set of blocks.                                                                        |
| [GetStandardChannelMaskFromXmaMask](/reference/audio/xma2defs/functions/getstandardchannelmaskfromxmamask)   | Converts between WAVEFORMATEXTENSIBLE channel masks and XMA channel masks.                                                                                      |
| [GetXmaBlockContainingSample](/reference/audio/xma2defs/functions/getxmablockcontainingsample)               | Use a specified seek table to find the XMA block that contains a specified decoded sample.                                                                      |
| [GetXmaChannelMaskFromStandardMask](/reference/audio/xma2defs/functions/getxmachannelmaskfromstandardmask)   | Converts between WAVEFORMATEXTENSIBLE channel masks and XMA channel masks.                                                                                      |
| [GetXmaDecodePositionForSample](/reference/audio/xma2defs/functions/getxmadecodepositionforsample)           | 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](/reference/audio/xma2defs/functions/getxmaframebitposition)                         | Calculates the bit offset of a specified frame within an XMA block or a set of blocks.                                                                          |
| [GetXmaFrameLengthInBits](/reference/audio/xma2defs/functions/getxmaframelengthinbits)                       | Reads a specified frame's LengthInBits field.                                                                                                                   |
| [GetXmaPacketFirstFrameOffsetInBits](/reference/audio/xma2defs/functions/getxmapacketfirstframeoffsetinbits) | Helper function for the XMA2PACKET structure. Returns the first frame offset.                                                                                   |
| [GetXmaPacketFrameCount](/reference/audio/xma2defs/functions/getxmapacketframecount)                         | Helper function for the XMA2PACKET structure. Returns the packet frame count.                                                                                   |
| [GetXmaPacketMetadata](/reference/audio/xma2defs/functions/getxmapacketmetadata)                             | Helper function for the XMA2PACKET structure.                                                                                                                   |
| [GetXmaPacketSkipCount](/reference/audio/xma2defs/functions/getxmapacketskipcount)                           | Helper function for the XMA2PACKET structure. Returns the packets from other streams to skip.                                                                   |
| [GetXmaSampleRate](/reference/audio/xma2defs/functions/getxmasamplerate)                                     | Obtains the legal XMA sample rate (24, 32, 44.1, or 48 KHz) that corresponds to a generic sample rate.                                                          |
| [LocalizeXma2Format](/reference/audio/xma2defs/functions/localizexma2format)                                 | 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](/reference/audio/xma2defs/structs/xma2packet)             | XMA packet structure (in big-endian form).                        |
| [XMA2STREAMFORMAT](/reference/audio/xma2defs/structs/xma2streamformat) | Structure used in XMA2WAVEFORMAT for per-stream data.             |
| [XMA2WAVEFORMAT](/reference/audio/xma2defs/structs/xma2waveformat)     | Legacy XMA2 format structure in big-endian byte order.            |
| [XMA2WAVEFORMATEX](/reference/audio/xma2defs/structs/xma2waveformatex) | The recommended way to express format information for XMA2 files. |
| [XMASTREAMFORMAT](/reference/audio/xma2defs/structs/xmastreamformat)   | Used in XMAWAVEFORMAT for per-stream data.                        |
| [XMAWAVEFORMAT](/reference/audio/xma2defs/structs/xmawaveformat)       | Structure of the legacy XMA1 format.                              |

## Conceptual documentation

* [XMA2 overview](/build/console-features/audio/overviews/xma2-overview)

## See also

[Audio API reference](/reference/audio/gc-reference-audio-toc)


## Related topics

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