> ## 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](/zh-TW/reference/audio/shapesrccontext/structs/shape_src_context)\*

指向 [SHAPE\_SRC\_CONTEXT](/zh-TW/reference/audio/shapesrccontext/structs/shape_src_context) 物件的指標。

*pitch*   \
類型：float

音高。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

## 備註

取樣率轉換器 (SRC) 區塊會讀取 PCM 樣本，並執行取樣率轉換和音高偏移。音高和目標音高值的範圍為 0.0625-3.99。若要取得目前的音高，請使用 [GetShapeSrcPitch](/zh-TW/reference/audio/shapesrccontext/functions/getshapesrcpitch)。

如需 SRC 的詳細資訊，請參閱 [SHAPE 概觀](/zh-TW/build/console-features/audio/overviews/shape-overview)中的[取樣率轉換器 (SRC) 區塊](/zh-TW/build/console-features/audio/overviews/shape-overview#ID4EOE)。

## 需求

**標頭：** shapesrccontext.h

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

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


## Related topics

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