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

# SetShapeSrcCommand

> SetShapeSrcCommand

# SetShapeSrcCommand

设置采样率转换器 (SRC) 命令。

## 语法

```cpp theme={null}
HRESULT SetShapeSrcCommand(  
         SHAPE_SRC_CONTEXT* context,  
         SHAPE_SRC_COMMAND_TYPE command  
)  
```

### 参数

*context*   \_Inout\_\
类型：[SHAPE\_SRC\_CONTEXT](/reference/audio/shapesrccontext/structs/shape_src_context)\*

指向 [SHAPE\_SRC\_CONTEXT](/reference/audio/shapesrccontext/structs/shape_src_context) 对象的指针。

*command*   \
类型：[SHAPE\_SRC\_COMMAND\_TYPE](/reference/audio/shapesrccontext/enums/shape_src_command_type)

[SHAPE\_SRC\_COMMAND\_TYPE](/reference/audio/shapesrccontext/enums/shape_src_command_type) 枚举的成员。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 备注

三种 SRC 命令如下所示。

| 命令                                      | 操作                                      |
| --------------------------------------- | --------------------------------------- |
| `SHAPE_SRC_COMMAND_TYPE_START`          | 执行正常处理，并期望在当前流图之后有更多音频数据。               |
| `SHAPE_SRC_COMMAND_TYPE_STOP_IMMEDIATE` | 立即停止处理源 XMA 或 PCM 数据。SRC 为此帧输出一个清零的缓冲区。 |
| `SHAPE_SRC_COMMAND_TYPE_STOP_END`       | 在当前数据包之后停止处理。                           |

有关更多详细信息，请参阅 [SHAPE\_SRC\_COMMAND\_TYPE](/reference/audio/shapesrccontext/enums/shape_src_command_type)。

若要获取当前 SRC 命令，请使用 [GetShapeSrcCommandType](/reference/audio/shapesrccontext/functions/getshapesrccommandtype)。

SRC 命令可能会被报告为已阻塞。有关更多信息，请参阅 [SHAPE 概述](/build/console-features/audio/overviews/shape-overview)的[被阻塞的命令](/build/console-features/audio/overviews/shape-overview#ID4EBGAC)部分。

## 要求

**标头：** shapesrccontext.h

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

## 另请参阅

[ShapeSrcContext](/reference/audio/shapesrccontext/shapesrccontext_members)


## Related topics

- [SetShapeSrcCommand 函数](/zh-CN/reference/audio/shapeflowgraph/functions/shapeflowgraph_setshapesrccommand.md)
- [SHAPE_SRC_COMMAND_TYPE](/zh-CN/reference/audio/shapesrccontext/enums/shape_src_command_type.md)
- [GetShapeSrcCommandType](/zh-CN/reference/audio/shapesrccontext/functions/getshapesrccommandtype.md)
- [ShapeFlowGraph](/zh-CN/reference/audio/shapeflowgraph/shapeflowgraph_members.md)
- [ShapeSrcContext](/zh-CN/reference/audio/shapesrccontext/shapesrccontext_members.md)
