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

# SetShapeSrcPitch

> SetShapeSrcPitch

# SetShapeSrcPitch

设置音调。

## 语法

```cpp theme={null}
HRESULT SetShapeSrcPitch(  
         SHAPE_SRC_CONTEXT* context,  
         float pitch  
)  
```

### 参数

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

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

*pitch*   \
类型：float

音调。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 备注

采样率转换器 (SRC) 块读取 PCM 样本并执行采样率转换和音调移位。音调和音调目标值的取值范围为 0.0625-3.99。若要获取当前音调，请使用 [GetShapeSrcPitch](/reference/audio/shapesrccontext/functions/getshapesrcpitch)。

有关 SRC 的更多信息，请参阅 [SHAPE 概述](/build/console-features/audio/overviews/shape-overview)中的[采样率转换器 (SRC) 块](/build/console-features/audio/overviews/shape-overview#ID4EOE)。

## 要求

**标头：** shapesrccontext.h

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

## 另请参阅

[SetShapeSrcPitchTarget](/reference/audio/shapesrccontext/functions/setshapesrcpitchtarget)\
[ShapeSrcContext](/reference/audio/shapesrccontext/shapesrccontext_members)


## Related topics

- [SetShapeSrcPitchTarget](/zh-CN/reference/audio/shapesrccontext/functions/setshapesrcpitchtarget.md)
- [GetShapeSrcPitch](/zh-CN/reference/audio/shapesrccontext/functions/getshapesrcpitch.md)
- [ShapeSrcContext](/zh-CN/reference/audio/shapesrccontext/shapesrccontext_members.md)
- [GetShapeSrcPitchTarget](/zh-CN/reference/audio/shapesrccontext/functions/getshapesrcpitchtarget.md)
- [PitchToShapeSrcSamplingIncrement](/zh-CN/reference/audio/shapesrccontext/functions/pitchtoshapesrcsamplingincrement.md)
