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

设置通道数。

<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)\*

指向 [SHAPE\_XMA\_CONTEXT](/reference/audio/shapexmacontext/structs/shape_xma_context) 对象的指针。

*numChannels*   \
Type: UINT32

通道数;取值为 1(单声道)或 2(立体声)。

<a id="retvalSection" />

### Return value

Type: HRESULT

HRESULT 成功或错误代码。

<a id="remarksSection" />

## Remarks

此函数设置上下文中的实际通道数。(在 [SHAPE\_XMA\_CONTEXT](/reference/audio/shapexmacontext/structs/shape_xma_context) 对象中,`numChannels` 成员包含值 0 \[单声道] 或 1 \[立体声]。)

若要获取当前通道数,请使用 [GetShapeXmaNumChannels](/reference/audio/shapexmacontext/functions/getshapexmanumchannels)。

有关详细信息,请参阅 [SHAPE 概述](/build/console-features/audio/overviews/shape-overview)的 [XMA](/build/console-features/audio/overviews/shape-overview#ID4EYD) 部分。

<a id="requirementsSection" />

## Requirements

**头文件:** shapexmacontext.h

**支持的平台:** XBOX One 系列主机和 XBOX Series 主机

<a id="seealsoSection" />

## See also

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


## Related topics

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