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

# SetShapeSrcCommand function

> SetShapeSrcCommand function

# SetShapeSrcCommand function

Initializes a SHAPE SRC command.

## Syntax

```cpp theme={null}
HRESULT SetShapeSrcCommand(  
         SHAPE_FLOWGRAPH_COMMAND* command,  
         UINT32 contextId,  
         UINT32 leftorMonoMixBuffer,  
         UINT32 rightMixBuffer  
)  
```

### Parameters

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

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

*contextId*   \
Type: UINT32

SRC context ID (index) this command will reference.

*leftorMonoMixBuffer*   \
Type: UINT32

Input mix buffer ID.

*rightMixBuffer*   \
Type: UINT32

Output mix buffer ID.

### Return value

Type: HRESULT

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

## Remarks

You can submit flowgraphs to be processed as persistent or non-persistent. Persistent flowgraphs process and then remain resident to repeat their processing in the next frame after read and write pointers have advanced and after other context information is updated. You can use persistent flowgraphs for either of the following scenarios.

* **Highly complex flowgraphs** that require a significant amount of CPU processing to reassemble each frame.
* **Highly static flowgraphs** with the same number and configuration of voices for an extended period of time.

Use non-persistent flowgraphs for any of the following scenarios.

* Voice topologies change frequently.
* The processing cadence of your title's audio software engine is detached from the SHAPE hardware that is not a multiple of 2.667 ms.
* You want to run audio processing faster than real-time, where you submit graphs to be consumed as quickly as they are available.

Many titles do not implement flowgraphs directly. [XAudio2](/build/console-features/audio/overviews/xaudio2-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

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

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


## Related topics

- [ShapeFlowGraph](/reference/audio/shapeflowgraph/shapeflowgraph_members.md)
- [SetShapeSrcCommand](/reference/audio/shapesrccontext/functions/shapesrccontext_setshapesrccommand.md)
- [SHAPE_SRC_COMMAND_TYPE](/reference/audio/shapesrccontext/enums/shape_src_command_type.md)
- [GetShapeSrcCommandType](/reference/audio/shapesrccontext/functions/getshapesrccommandtype.md)
- [ShapeSrcContext](/reference/audio/shapesrccontext/shapesrccontext_members.md)
