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

# GetXmaFrameLengthInBits

> GetXmaFrameLengthInBits

# GetXmaFrameLengthInBits

지정된 프레임의 `LengthInBits` 필드를 읽습니다.

## 구문

```cpp theme={null}
DWORD GetXmaFrameLengthInBits(  
         const BYTE* pPacket,  
         DWORD nBitPosition  
)  
```

### 매개 변수

*pPacket*   \_In\_\
형식: BYTE\*

프레임을 포함하는 XMA 패킷에 대한 포인터입니다.

*nBitPosition*   \
형식: DWORD

이 패킷 내 프레임의 비트 오프셋입니다.

### 반환 값

형식: DWORD

비트 단위 길이입니다.

## 설명

아래 코드 예제와 같이, 이 함수는 지정된 프레임의 `LengthInBits` 필드를 읽습니다.

```cpp theme={null}

__inline DWORD GetXmaFrameLengthInBits
(
    __in_bcount(nBitPosition / 8 + 3)
    __in const BYTE* pPacket,  // Pointer to XMA packet[s] containing the frame
    DWORD nBitPosition         // Bit offset of the frame within this packet
)
{
    DWORD nRegion;
    DWORD nBytePosition = nBitPosition / 8;
    DWORD nBitOffset = nBitPosition % 8;

    if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more)
    {
        nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 |
                  (DWORD)(pPacket[nBytePosition+1]);
        return (nRegion >> (1 - nBitOffset)) & 0x7FFF;  // Last 15 bits
    }
    else // Need to read 3 bytes
    {
        nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 |
                  (DWORD)(pPacket[nBytePosition+1]) << 8 |
                  (DWORD)(pPacket[nBytePosition+2]);
        return (nRegion >> (9 - nBitOffset)) & 0x7FFF;  // Last 15 bits
    }
}
```

XMA2에 대한 자세한 내용은 [XMA2 개요](/build/console-features/audio/overviews/xma2-overview)를 참조하세요. XBOX One의 오디오 아키텍처 개요는 **미래의 사운드**: [XBOX One의 오디오 아키텍처](/build/console-features/audio/overviews/xbox-one-audio-architecture)를 참조하세요.

## 요구 사항

**헤더:** xma2defs.h

**지원 플랫폼:** XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 관련 항목

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


## Related topics

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