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

# SHAPE_PCM_CONTEXT

> SHAPE_PCM_CONTEXT

# SHAPE\_PCM\_CONTEXT

PCM 上下文结构体。

## 语法

```cpp theme={null}
typedef struct SHAPE_PCM_CONTEXT {
    UINT32 bufferStart : 32;  
    UINT32 bufferLength : 21;  
    UINT32 reserved0 : 11;  
    UINT32 loopCount : 8;  
    UINT32 reserved1 : 8;  
    UINT32 full : 1;  
    UINT32 reserved2 : 15;  
    UINT32 readPointer : 21;  
    UINT32 reserved3 : 11;  
    UINT32 loopStartWritePointer : 21;  
    UINT32 reserved4 : 11;  
    UINT32 loopEnd : 21;  
    UINT32 reserved5 : 11;  
    UINT32 mode : 1;  
    UINT32 reserved6 : 15;  
    UINT32 format : 2;  
    UINT32 reserved7 : 14;  
    UINT32 reserved[1];  
} SHAPE_PCM_CONTEXT  
```

### 成员

*bufferStart*\
类型：UINT32

写入：音频缓冲区。

*bufferLength*\
类型：UINT32

写入：以样本为单位的音频缓冲区长度。

*reserved0*\
类型：UINT32

保留。

*loopCount*\
类型：UINT32

读取/写入：循环计数。

*reserved1*\
类型：UINT32

保留。

*full*\
类型：UINT32

写入：对于环形缓冲区，当 *readPointer* 与 *loopStartWritePointer* 相同时：1 == 缓冲区已满，0 == 缓冲区为空。

*reserved2*\
类型：UINT32

保留。

*readPointer*\
类型：UINT32

读取/写入：从音频缓冲区开头开始的以样本为单位的帧对齐 128 采样偏移量。低 7 位被忽略。

*reserved3*\
类型：UINT32

保留。

*loopStartWritePointer*\
类型：UINT32

写入：从音频缓冲区开头开始的非帧对齐样本偏移量。指示线性缓冲区的循环起点，或环形缓冲区的写入指针。

*reserved4*\
类型：UINT32

保留。

*loopEnd*\
类型：UINT32

写入：从音频缓冲区开头开始的非帧对齐样本偏移量。指示循环结束位置。最小循环大小为 128 个样本。

*reserved5*\
类型：UINT32

保留。

*mode*\
类型：UINT32

写入：SHAPE\_PCM\_MODE

*reserved6*\
类型：UINT32

保留。

*format*\
类型：UINT32

写入：SHAPE\_PCM\_FORMAT

*reserved7*\
类型：UINT32

保留。

*reserved*\
类型：UINT32\[1]

保留。

## 备注

标记为 **Write** 的字段由你的应用程序设置，并且不会被音频控制处理器 (ACP) 库更改。标记为 **Read/Write** 的字段由你的应用程序设置，但可以由 ACP 库更改。

脉冲编码调制 (PCM) 缓冲区的大小取决于缓冲区的格式。请参阅 [SHAPE\_PCM\_FORMAT](/reference/audio/shapepcmcontext/enums/shape_pcm_format) 的备注。

## 要求

**标头：** shapepcmcontext.h

**支持的平台：** XBOX One 系列主机和 XBOX Series 主机

## 概念文档

* [ACP 概述](/build/console-features/audio/overviews/acp-overview)

## 另请参阅

[ACP 概述](/build/console-features/audio/overviews/acp-overview)\
[Shape 概述](/build/console-features/audio/overviews/shape-overview)\
[shapepcmcontext](/reference/audio/shapepcmcontext/shapepcmcontext_members)


## Related topics

- [ShapePcmContext](/zh-CN/reference/audio/shapepcmcontext/shapepcmcontext_members.md)
- [GetShapePcmFormat](/zh-CN/reference/audio/shapepcmcontext/functions/getshapepcmformat.md)
- [GetShapePcmMode](/zh-CN/reference/audio/shapepcmcontext/functions/getshapepcmmode.md)
- [SetShapePcmFormat](/zh-CN/reference/audio/shapepcmcontext/functions/setshapepcmformat.md)
- [SetShapePcmMode](/zh-CN/reference/audio/shapepcmcontext/functions/setshapepcmmode.md)
