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

# SetShapeEqCompThreshold

> SetShapeEqCompThreshold

# SetShapeEqCompThreshold

设置压缩阈值。

## 语法

```cpp theme={null}
HRESULT SetShapeEqCompThreshold(  
         SHAPE_EQCOMP_CONTEXT* context,  
         float threshold  
)  
```

### 参数

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

指向 `SHAPE_EQCOMP_CONTEXT` 对象的指针。

*threshold*   \
类型:float

压缩阈值。

### 返回值

类型:HRESULT

HRESULT 成功或错误代码。

## 注解

压缩器只对超过特定阈值的信号起作用;低于阈值的信号将不经改变直接通过。

压缩器根据一个参数改变声音数据,该参数指定输入电平与输出电平的比值。该比值表示当输入信号超过阈值时对其进行衰减的程度。(如果压缩器/扩展器模式设置为 `SHAPE_EQCOMP_EXPAND_MODE_EXPANDER`,行为则相反。扩展器对低于特定阈值的信号起作用;高于阈值的信号不经改变直接通过。)

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

## 要求

**头文件:** shapeeqcompcontext.h

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

## 另请参阅

[GetShapeEqCompThreshold](/reference/audio/shapeeqcompcontext/functions/getshapeeqcompthreshold)\
[ShapeEqCompContext](/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members)


## Related topics

- [GetShapeEqCompThreshold](/zh-CN/reference/audio/shapeeqcompcontext/functions/getshapeeqcompthreshold.md)
- [SetShapeEqCompExpandMode](/zh-CN/reference/audio/shapeeqcompcontext/functions/setshapeeqcompexpandmode.md)
- [ShapeEqCompContext](/zh-CN/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members.md)
- [SetShapeEqCompRelease](/zh-CN/reference/audio/shapeeqcompcontext/functions/setshapeeqcomprelease.md)
- [SetShapeEqCompAttack](/zh-CN/reference/audio/shapeeqcompcontext/functions/setshapeeqcompattack.md)
