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

# SetShapeXmaNumChannels

> SetShapeXmaNumChannels

# SetShapeXmaNumChannels

Sets the number of channels.

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

*context*   \_Inout\_\
Type: [SHAPE\_XMA\_CONTEXT](/reference/audio/shapexmacontext/structs/shape_xma_context)\*

Pointer to a [SHAPE\_XMA\_CONTEXT](/reference/audio/shapexmacontext/structs/shape_xma_context) object.

*numChannels*   \
Type: UINT32

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

<a id="retvalSection" />

### Return value

Type: HRESULT

HRESULT success or error code.

<a id="remarksSection" />

## Remarks

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

To get the current number of channels, use [GetShapeXmaNumChannels](/reference/audio/shapexmacontext/functions/getshapexmanumchannels).

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

<a id="requirementsSection" />

## Requirements

**Header:** shapexmacontext.h

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

<a id="seealsoSection" />

## See also

[ShapeXmaContext](/reference/audio/shapexmacontext/shapexmacontext_members)


## Related topics

- [GetShapeXmaNumChannels](/reference/audio/shapexmacontext/functions/getshapexmanumchannels.md)
- [ShapeXmaContext](/reference/audio/shapexmacontext/shapexmacontext_members.md)
- [SetShapeDmaNumChannels](/reference/audio/shapedmacontext/functions/setshapedmanumchannels.md)
- [SetShapeXmaNumLoops](/reference/audio/shapexmacontext/functions/setshapexmanumloops.md)
- [SetShapeXmaNumSubframesToDecode](/reference/audio/shapexmacontext/functions/setshapexmanumsubframestodecode.md)
