> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SetShapeXmaNumChannels

> SetShapeXmaNumChannels

Sets the number of channels.

## Syntax

```cpp theme={null}
HRESULT SetShapeXmaNumChannels(  
         SHAPE_XMA_CONTEXT* context,  
         UINT32 numChannels  
)  
```

### Parameters

*context*   \_Inout\_\
Type: [SHAPE\_XMA\_CONTEXT](https://docs.xbox.com/reference/audio/shapexmacontext/structs/shape_xma_context.md)\*

Pointer to a [SHAPE\_XMA\_CONTEXT](https://docs.xbox.com/reference/audio/shapexmacontext/structs/shape_xma_context.md) object.

*numChannels*   \
Type: UINT32

Number of channels; either 1 (mono) or 2 (stereo).

### Return value

Type: HRESULT

HRESULT success or error code.

## Remarks

This function sets the actual number of channels in the context. (In the [SHAPE\_XMA\_CONTEXT](https://docs.xbox.com/reference/audio/shapexmacontext/structs/shape_xma_context.md) object, the `numChannels` member contains the values 0 \[mono] or 1 \[stereo].)

To get the current number of channels, use [GetShapeXmaNumChannels](https://docs.xbox.com/reference/audio/shapexmacontext/functions/getshapexmanumchannels.md).

For more information, see the [XMA](https://docs.xbox.com/build/console-features/audio/overviews/shape-overview.md#ID4EYD) section of [Overview of SHAPE](https://docs.xbox.com/build/console-features/audio/overviews/shape-overview.md).

## Requirements

**Header:** shapexmacontext.h

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

## See also

[ShapeXmaContext](https://docs.xbox.com/reference/audio/shapexmacontext/shapexmacontext_members.md)


## Related topics

- [GetShapeXmaNumChannels](https://docs.xbox.com/reference/audio/shapexmacontext/functions/getshapexmanumchannels.md)
- [ShapeXmaContext](https://docs.xbox.com/reference/audio/shapexmacontext/shapexmacontext_members.md)
- [SetShapeDmaNumChannels](https://docs.xbox.com/reference/audio/shapedmacontext/functions/setshapedmanumchannels.md)
- [SetShapeXmaNumLoops](https://docs.xbox.com/reference/audio/shapexmacontext/functions/setshapexmanumloops.md)
- [SetShapeXmaNumSubframesToSkip](https://docs.xbox.com/reference/audio/shapexmacontext/functions/setshapexmanumsubframestoskip.md)
