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

# SetShapeAllocMixBufferCommand

> SetShapeAllocMixBufferCommand

# SetShapeAllocMixBufferCommand

Allocates a virtual mix buffer.

## Syntax

```cpp theme={null}
HRESULT SetShapeAllocMixBufferCommand(  
         SHAPE_FLOWGRAPH_COMMAND* command,  
         UINT32 virtualId,  
         UINT32 numIn,  
         UINT32 numOut,  
         SHAPE_MIXBUFFER_ATTENUATION attenuation  
)  
```

### Parameters

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

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

*virtualId*   \
Type: UINT32

Virtual ID of the mix buffer, from 0 to 8191, inclusive. Each allocated mix buffers must have a unique virtual ID.

*numIn*   \
Type: UINT32

Number of inputs to the mix buffer. This value specifies the number of Scalable Hardware Audio Processing Engine (SHAPE) blocks that will output to this mix buffer.

*numOut*   \
Type: UINT32

Number of outputs from the mix buffer. This value specifies the number of SHAPE blocks that will read from this mix buffer.

*attenuation*   \
Type: SHAPE\_MIXBUFFER\_ATTENUATION

One member of the [SHAPE\_MIXBUFFER\_ATTENUATION](/reference/audio/shapeflowgraph/enums/shape_mixbuffer_attenuation) enumeration. This value specifies the dB attenuation applied to all inputs to this mix buffer.

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

All mix buffers are single channel (mono) and must be allocated before use. Although there are a total of 128 physical mix buffers, there are 8192 virtual mix buffers available. Physical mix buffers can be reused, but virtual mix buffers cannot be.

The execution list uses virtual IDs for mix buffer assignments. It is only when an allocate command is executed that a physical mix buffer is bound to a given virtual ID. Subsequent commands that use a given virtual ID will be directed to the allocated physical mix buffer. The allocate command is dispatched from the SHAPE Processor to the mix buffer block, which performs the virtual ID to physical mix buffer binding.

Many titles do not implement flowgraphs directly. [XAudio2](/build/console-features/audio/overviews/xma2-overview) and audio middleware implement SHAPE components implicitly. However, constructing flowgraphs provides the greatest flexibility and access to the audio-acceleration capabilities of the XBOX One console.

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

- [SHAPE_FLOWGRAPH_COMMAND_TYPE](/reference/audio/shapeflowgraph/enums/shape_flowgraph_command_type.md)
- [ShapeFlowGraph](/reference/audio/shapeflowgraph/shapeflowgraph_members.md)
- [SHAPE_FLOWGRAPH_ALLOC_MIXBUFFER_COMMAND](/reference/audio/shapeflowgraph/structs/shape_flowgraph_alloc_mixbuffer_command.md)
- [SetShapeDmaCommand](/reference/audio/shapeflowgraph/functions/setshapedmacommand.md)
- [SHAPE_FLOWGRAPH_COMMAND](/reference/audio/shapeflowgraph/structs/shape_flowgraph_command.md)
