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

# SetShapeEqCompGainTarget

> SetShapeEqCompGainTarget

# SetShapeEqCompGainTarget

设置压缩器输出（补偿）增益的目标值。

## 语法

```cpp theme={null}
HRESULT SetShapeEqCompGainTarget(  
         SHAPE_EQCOMP_CONTEXT* context,  
         float gainTarget  
)  
```

### 参数

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

指向 `SHAPE_EQCOMP_CONTEXT` 对象的指针。

*gainTarget*   
类型：float

增益目标值。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 备注

压缩器通过监视输入的电平并创建动态增益值来限制信号的动态范围。然后，压缩器将增益值作为信号的乘数，根据当前的输入信号电平对其进行相应的缩放。换句话说，压缩器是一种持续监视输入信号并进行自我调整的自动音量控制。

有关详细信息，请参阅 [SHAPE 概述](/build/console-features/audio/overviews/shape-overview) 中的 [均衡与压缩](/build/console-features/audio/overviews/shape-overview#ID4ECF)。

## 要求

**头文件：** shapeeqcompcontext.h

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

## 另请参阅

[GetShapeEqCompGainTarget](/reference/audio/shapeeqcompcontext/functions/getshapeeqcompgaintarget)\
[ShapeEqCompContext](/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members)


## Related topics

- [GetShapeEqCompGainTarget](/zh-CN/reference/audio/shapeeqcompcontext/functions/getshapeeqcompgaintarget.md)
- [ShapeEqCompContext](/zh-CN/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members.md)
- [SetShapeEqCompGain](/zh-CN/reference/audio/shapeeqcompcontext/functions/setshapeeqcompgain.md)
- [SetShapeEqCompLogGain](/zh-CN/reference/audio/shapeeqcompcontext/functions/setshapeeqcomploggain.md)
- [GetShapeEqCompGain](/zh-CN/reference/audio/shapeeqcompcontext/functions/getshapeeqcompgain.md)
