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

# SetShapeEqCompEnableCompressor

> SetShapeEqCompEnableCompressor

# SetShapeEqCompEnableCompressor

设置压缩器标志的状态。

## 语法

```cpp theme={null}
HRESULT SetShapeEqCompEnableCompressor(  
         SHAPE_EQCOMP_CONTEXT* context,  
         bool enable  
)  
```

### 参数

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

指向 SHAPE\_EQCOMP\_CONTEXT 对象的指针。

*enable*   \
类型：bool

设为 True 可启用均衡器/压缩器-扩展器模块中的压缩器部分。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 备注

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

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

## 要求

**头文件：** shapeeqcompcontext.h

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

## 另请参阅

[ShapeEqCompContext](/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members)


## Related topics

- [SHAPE_EQCOMP_EXPAND_MODE](/zh-CN/reference/audio/shapeeqcompcontext/enums/shape_eqcomp_expand_mode.md)
- [ShapeEqCompContext](/zh-CN/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members.md)
- [GetShapeEqCompEnableCompressor](/zh-CN/reference/audio/shapeeqcompcontext/functions/getshapeeqcompenablecompressor.md)
- [SetShapeEqCompCompressorMode](/zh-CN/reference/audio/shapeeqcompcontext/functions/setshapeeqcompcompressormode.md)
- [GetShapeEqCompCompressorMode](/zh-CN/reference/audio/shapeeqcompcontext/functions/getshapeeqcompcompressormode.md)
