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

## 語法

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

<a id="parametersSection" />

### 參數

*context*   \_Inout\_\
類型：[SHAPE\_XMA\_CONTEXT](/zh-TW/reference/audio/shapexmacontext/structs/shape_xma_context)\*

指向 [SHAPE\_XMA\_CONTEXT](/zh-TW/reference/audio/shapexmacontext/structs/shape_xma_context) 物件的指標。

*numChannels*   \
類型：UINT32

聲道數目；1 (單聲道) 或 2 (立體聲)。

<a id="retvalSection" />

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

<a id="remarksSection" />

## 備註

此函式會設定內容中實際的聲道數目。(在 [SHAPE\_XMA\_CONTEXT](/zh-TW/reference/audio/shapexmacontext/structs/shape_xma_context) 物件中，`numChannels` 成員包含的值為 0 \[單聲道] 或 1 \[立體聲]。)

若要取得目前的聲道數目，請使用 [GetShapeXmaNumChannels](/zh-TW/reference/audio/shapexmacontext/functions/getshapexmanumchannels)。

如需詳細資訊，請參閱 [SHAPE 概觀](/zh-TW/build/console-features/audio/overviews/shape-overview)中的 [XMA](/zh-TW/build/console-features/audio/overviews/shape-overview#ID4EYD) 一節。

<a id="requirementsSection" />

## 需求

**標頭：** shapexmacontext.h

**支援的平台：** XBOX One 系列主機與 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[ShapeXmaContext](/zh-TW/reference/audio/shapexmacontext/shapexmacontext_members)


## Related topics

- [SetShapeXmaNumChannels](/reference/audio/shapexmacontext/functions/setshapexmanumchannels.md)
- [GetShapeXmaNumChannels](/reference/audio/shapexmacontext/functions/getshapexmanumchannels.md)
