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

# SHARED_SHAPE_CONTEXTS

> SHARED_SHAPE_CONTEXTS

# SHARED\_SHAPE\_CONTEXTS

This structure is used when Scalable Hardware Audio Processing Engine (SHAPE) and XBOX Media Audio (XMA) resources are shared with `XAudio2` instances.

## Syntax

```cpp theme={null}
typedef struct SHARED_SHAPE_CONTEXTS {  
    SHAPE_CONTEXTS* shapeContexts;  
    UINT32 sharedSrcContextIndex;  
    UINT32 sharedEqCompContextIndex;  
    UINT32 sharedFiltVolContextIndex;  
    UINT32 sharedDmaContextIndex;  
    UINT32 sharedXmaContextIndex;  
    UINT32 sharedPcmContextIndex;  
    UINT32 numSharedSrcContexts;  
    UINT32 numSharedEqCompContexts;  
    UINT32 numSharedFiltVolContexts;  
    UINT32 numSharedDmaContexts;  
    UINT32 numSharedXmaContexts;  
    UINT32 numSharedPcmContexts;  
} SHARED_SHAPE_CONTEXTS  
```

### Members

*shapeContexts*\
Type: [SHAPE\_CONTEXTS\*](/reference/audio/acphal/structs/shape_contexts)

Pointer to a [SHAPE\_CONTEXTS](/reference/audio/acphal/structs/shape_contexts) structure.

*sharedSrcContextIndex*\
Type: UINT32

The index of the first Sample Rate Convertor (SRC) context to share.

*sharedEqCompContextIndex*\
Type: UINT32

The index of the first EQ/Comp context to share.

*sharedFiltVolContextIndex*\
Type: UINT32

The index of the first Filter/Volume context to share.

*sharedDmaContextIndex*\
Type: UINT32

The index of the first Direct Memory Access (DMA) context to share.

*sharedXmaContextIndex*\
Type: UINT32

The index of the first XMA context to share.

*sharedPcmContextIndex*\
Type: UINT32

The index of the first pulse-code modulation (PCM) context to share.

*numSharedSrcContexts*\
Type: UINT32

The number of SRC contexts to share, starting from *sharedSrcContextIndex*.

*numSharedEqCompContexts*\
Type: UINT32

The number of EQ/Comp contexts to share, starting from *sharedEqCompContextIndex*.

*numSharedFiltVolContexts*\
Type: UINT32

The number of Filter/Volume contexts to share, starting from *sharedFiltVolContextIndex*.

*numSharedDmaContexts*\
Type: UINT32

The number of DMA contexts to share, starting from *sharedDmaContextIndex*.

*numSharedXmaContexts*\
Type: UINT32

The number of XMA contexts to share, starting from *sharedXmaContextIndex*.

*numSharedPcmContexts*\
Type: UINT32

The number of PCM contexts to share, starting from *sharedPcmContextIndex*.

## Remarks

This structure is used by the [XAudio2CreateWithSharedContexts](/reference/audio/xaudio2xbox/functions/xaudio2createwithsharedcontexts) function. The function works the same way as `XAudio2Create` but takes `SHARED_SHAPE_CONTEXTS` as an additional parameter. You can share state for SHAPE across multiple `IXAudio2` instances.

## Requirements

**Header:** acphal.h

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

## See also

[XAudio2CreateWithSharedContexts](/reference/audio/xaudio2xbox/functions/xaudio2createwithsharedcontexts)\
[XAudio2Create](https://learn.microsoft.com/windows/desktop/api/xaudio2/nf-xaudio2-xaudio2create)\
[AcpHal](/reference/audio/acphal/acphal_members)


## Related topics

- [XAudio2CreateWithSharedContexts](/reference/audio/xaudio2xbox/functions/xaudio2createwithsharedcontexts.md)
- [AcpHal](/reference/audio/acphal/acphal_members.md)
- [AcpHalReleaseShapeContexts](/reference/audio/acphal/functions/acphalreleaseshapecontexts.md)
- [SHAPE_CONTEXTS](/reference/audio/acphal/structs/shape_contexts.md)
- [ShapeContexts](/reference/audio/shapecontexts/shapecontexts_members.md)
