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

Sets the compression ratio.

## Syntax

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

### Parameters

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

Pointer to a SHAPE\_EQCOMP\_CONTEXT object.

*ratio*   \
Type: float

The compression ratio.

### Return value

Type: HRESULT

HRESULT success or error code.

## Remarks

The compressor alters the sound data according to the ratio of incoming level to outgoing level. The ratio determines how much attenuation should be done on the incoming signal when it exceeds the threshold. For example, at a ratio of 2:1, every 2 dB of level over the threshold results in 1 dB output from the compressor over the threshold level. With a ratio of 1:1, the compressor is essentially off.

For more information, see [Equalization and compression](/build/console-features/audio/overviews/shape-overview#ID4ECF) in [Overview of SHAPE](/build/console-features/audio/overviews/shape-overview).

## Requirements

**Header:** shapeeqcompcontext.h

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

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


## Related topics

- [ShapeEqCompContext](/reference/audio/shapeeqcompcontext/shapeeqcompcontext_members.md)
- [SetShapeEqCompCommand](/reference/audio/shapeflowgraph/functions/setshapeeqcompcommand.md)
- [GetShapeEqCompRatio](/reference/audio/shapeeqcompcontext/functions/getshapeeqcompratio.md)
- [SetShapeEqCompThreshold](/reference/audio/shapeeqcompcontext/functions/setshapeeqcompthreshold.md)
- [SetShapeEqCompAttack](/reference/audio/shapeeqcompcontext/functions/setshapeeqcompattack.md)
