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

# SetShapeEqCompRatio

> SetShapeEqCompRatio

# SetShapeEqCompRatio

設定壓縮比。

## 語法

```cpp theme={null}
HRESULT SetShapeEqCompRatio(  
         SHAPE_EQCOMP_CONTEXT* context,  
         float ratio  
)  
```

### 參數

*context*   \_Inout\_\
類型：[SHAPE\_EQCOMP\_CONTEXT\*](/zh-TW/reference/audio/shapeeqcompcontext/structs/shape_eqcomp_context)

指向 SHAPE\_EQCOMP\_CONTEXT 物件的指標。

*ratio*   \
類型：float

壓縮比。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

## 備註

壓縮器會根據輸入位準與輸出位準的比率來改變聲音資料。比率決定輸入訊號超過臨界值時應進行多少衰減。例如，在 2:1 的比率下，超過臨界值的每 2 dB 位準，會讓壓縮器輸出超過臨界值位準 1 dB。若比率為 1:1，壓縮器基本上處於關閉狀態。

如需詳細資訊，請參閱 [SHAPE 概觀](/zh-TW/build/console-features/audio/overviews/shape-overview)中的[等化與壓縮](/zh-TW/build/console-features/audio/overviews/shape-overview#ID4ECF)。

## 需求

**標頭：** shapeeqcompcontext.h

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

## 另請參閱

[ShapeEqCompContext](/zh-TW/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members)


## Related topics

- [ShapeEqCompContext](/zh-TW/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members.md)
- [GetShapeEqCompRatio](/zh-TW/reference/audio/shapeeqcompcontext/functions/getshapeeqcompratio.md)
- [SetShapeEqCompAttack](/zh-TW/reference/audio/shapeeqcompcontext/functions/setshapeeqcompattack.md)
- [SetShapeEqCompGain](/zh-TW/reference/audio/shapeeqcompcontext/functions/setshapeeqcompgain.md)
- [SetShapeEqCompRelease](/zh-TW/reference/audio/shapeeqcompcontext/functions/setshapeeqcomprelease.md)
