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

# SetShapeEqCompCommand

> SetShapeEqCompCommand

# SetShapeEqCompCommand

Initializes a SHAPE EQ/Comp command.

## Syntax

```cpp theme={null}
HRESULT SetShapeEqCompCommand(  
         SHAPE_FLOWGRAPH_COMMAND* command,  
         UINT32 contextId,  
         UINT32 inputMixBuffer,  
         UINT32 sidechainMixBuffer,  
         UINT32 outputMixBuffer  
)  
```

### Parameters

*command*   \_Inout\_\
Type: SHAPE\_FLOWGRAPH\_COMMAND\*

The [SHAPE\_FLOWGRAPH\_COMMAND](/reference/audio/shapeflowgraph/structs/shape_flowgraph_command) command to initialize.

*contextId*   \
Type: UINT32

EQ/Comp context ID (index) this command will reference.

*inputMixBuffer*   \
Type: UINT32

Input mix buffer ID.

*sidechainMixBuffer*   \
Type: UINT32

Sidechain mix buffer. This parameter is used for external sidechains only and is ignored for normal and internal sidechains. For more information, see [SHAPE\_EQCOMP\_SIDECHAIN\_MODE](/reference/audio/shapeeqcompcontext/enums/shape_eqcomp_sidechain_mode).

*outputMixBuffer*   \
Type: UINT32

Output mix buffer ID.

### Return value

Type: HRESULT

If the function succeeds it returns `S_OK`. If one or more arguments are invalid, the function returns `E_INVALIDARG`.

## Remarks

The purpose of the compressor is to limit the amount of dynamic range in the signal. It does this by monitoring the level of input and creating a dynamic gain value. The gain value is then used as a multiplier of the signal and scales it appropriately depending on the current level of the input signal. In other words, it is an automatic volume control, which constantly monitors the input signal and is constantly adjusting itself.

The compressor acts only on signals above a specific threshold. If the signal is less than the threshold, the signal passes through unaltered. Threshold is set by the application as part of the EQComp context data. There is programmable control in the context to perform compression or expansion.

The compressor alters the sound data according to a ratio parameter. This specifies how much attenuation should be done on the incoming signal if it exceeds the threshold. The ratio is exactly that. It is the ratio of the incoming level to outgoing level. 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. Ratio is set by the application as part of the context data.

## Requirements

**Header:** shapeflowgraph.h

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

## See also

[ACP Overview](/build/console-features/audio/overviews/acp-overview)

[SHAPE Overview](/build/console-features/audio/overviews/shape-overview)

[shapeflowgraph](/reference/audio/shapeflowgraph/shapeflowgraph_members)


## Related topics

- [ShapeFlowGraph](/reference/audio/shapeflowgraph/shapeflowgraph_members.md)
- [SetShapeEqCompAttack](/reference/audio/shapeeqcompcontext/functions/setshapeeqcompattack.md)
- [SetShapeEqCompGain](/reference/audio/shapeeqcompcontext/functions/setshapeeqcompgain.md)
- [SetShapeEqCompRatio](/reference/audio/shapeeqcompcontext/functions/setshapeeqcompratio.md)
- [SetShapeEqCompRelease](/reference/audio/shapeeqcompcontext/functions/setshapeeqcomprelease.md)
