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

# SetShapeEqCompGain

> SetShapeEqCompGain

# SetShapeEqCompGain

設定壓縮器的輸出 (補償) 增益。

## 語法

```cpp theme={null}
HRESULT SetShapeEqCompGain(  
         SHAPE_EQCOMP_CONTEXT* context,  
         float gain  
)  
```

### 參數

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

指向 `SHAPE_EQCOMP_CONTEXT` 物件的指標。

*gain*   \
類型：float

增益乘數。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

## 備註

壓縮器會監視輸入位準並建立動態增益值，藉此限制訊號的動態範圍。接著，壓縮器會將增益值作為訊號的乘數，根據輸入訊號的目前位準適當地縮放訊號。換句話說，壓縮器是一種自動音量控制，會持續監視輸入訊號並自行調整。

如需詳細資訊，請參閱 [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 主機

## 另請參閱

[GetShapeEqCompGain](/zh-TW/reference/audio/shapeeqcompcontext/functions/getshapeeqcompgain)\
[ShapeEqCompContext](/zh-TW/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members)


## Related topics

- [GetShapeEqCompGain](/zh-TW/reference/audio/shapeeqcompcontext/functions/getshapeeqcompgain.md)
- [ShapeEqCompContext](/zh-TW/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members.md)
- [SetShapeEqCompGainTarget](/zh-TW/reference/audio/shapeeqcompcontext/functions/setshapeeqcompgaintarget.md)
- [SetShapeEqCompLogGain](/zh-TW/reference/audio/shapeeqcompcontext/functions/setshapeeqcomploggain.md)
- [GetShapeEqCompLogGain](/zh-TW/reference/audio/shapeeqcompcontext/functions/getshapeeqcomploggain.md)
