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

# XMA2PACKET

> XMA2PACKET

XBOX Media Audio (XMA) packet structure in big-endian form.

## Syntax

```cpp theme={null}
typedef struct XMA2PACKET {  
    int FrameCount : 6;  
    int FrameOffsetInBits : 15;  
    int PacketMetaData : 3;  
    int PacketSkipCount : 8;  
    BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof ( DWORD )];  
} XMA2PACKET  
```

### Members

*FrameCount*\
Type: int

Number of XMA frames that begin in this packet.

*FrameOffsetInBits*\
Type: int

Bit of *XmaData* where the first complete frame begins.

*PacketMetaData*\
Type: int

Metadata stored in the packet. Always 1 for XMA2.

*PacketSkipCount*\
Type: int

Number of packets that belong to other streams that must be skipped to find the next packet that belongs to this stream.

*XmaData*\
Type: BYTE\[XMA\_BYTES\_PER\_PACKET - sizeof ( DWORD )]

XMA-encoded data.

## Remarks

The `XMA2PACKET` structure will skip 2 packets to find the next one for this stream. It uses the `XMA2` signature, which it is 001. The first frame starts 527 bits into the packet. The packet contains 12 frames. In the following example, the first *DWORD* of a packet is 0x30107902. The packet contains 12 frames. The first frame begins 527 buts into the packet. To find the next packet for this stream, skip 2 packets.

```
      // 001100 000001000001111 001 00000010  
      //    |          |         |      |____ Skip 2 packets to find the next one for this stream  
      //    |          |         |___________ XMA2 signature (this is always 001)  
      //    |          |_____________________ First frame starts 527 bits into the packet  
      //    |________________________________ The packet contains 12 frames  
```

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

[Overview of XMA2](https://docs.xbox.com/build/console-features/audio/overviews/xma2-overview.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)
- [GetXmaPacketMetadata](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketmetadata.md)
- [GetXmaPacketFirstFrameOffsetInBits](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketfirstframeoffsetinbits.md)
- [GetXmaPacketFrameCount](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketframecount.md)
- [GetXmaPacketSkipCount](https://docs.xbox.com/reference/audio/xma2defs/functions/getxmapacketskipcount.md)
