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

# SetShapeDmaFloatSamples

> SetShapeDmaFloatSamples

# SetShapeDmaFloatSamples

設定旗標，指出音訊緩衝區中的樣本包含浮點資料還是 32 位元整數資料。

## 語法

```cpp theme={null}
HRESULT SetShapeDmaFloatSamples(  
         SHAPE_DMA_CONTEXT* context,  
         bool floatSamples  
)  
```

### 參數

*context*   \_Inout\_\
類型: [SHAPE\_DMA\_CONTEXT\*](/zh-TW/reference/audio/shapedmacontext/structs/shape_dma_context)

[SHAPE\_DMA\_CONTEXT](/zh-TW/reference/audio/shapedmacontext/structs/shape_dma_context) 結構的指標。

*floatSamples*   \
類型: bool

浮點旗標: 1 == 浮點資料；0 == 32 位元整數資料。

### 傳回值

類型: HRESULT

HRESULT 成功或錯誤碼。

## 備註

直接記憶體存取 (DMA) 系統支援讀取和寫入功能，並可自動進行浮點數轉整數及整數轉浮點數的轉換。DMA 系統使用包含 128 個樣本區塊之非交錯樣本的循環緩衝區。

DMA 處理器可讓可調整硬體音訊處理引擎 (SHAPE) 將資料從混音緩衝區傳送到主系統記憶體，並從主系統擷取資料到混音緩衝區以供進一步處理。DMA 以區塊為單位進行，一次傳輸一個音訊框架的資料。為了支援區塊交錯資料，略過值會指定讀取或寫入樣本時，要在系統記憶體中 (從基底位址) 略過的音訊框架區塊數目。因此，多聲道串流的每個聲道都需要一個 DMA 內容。

音訊資料樣本一律以 32 位元值 (整數或浮點數) 讀取和寫入，如 [SHAPE\_DMA\_CONTEXT](/zh-TW/reference/audio/shapedmacontext/structs/shape_dma_context) 結構的 `floatConvert` 旗標所指定。請注意，DMA 的方向 (讀取或寫入) 是在 DMA 命令中指定，而不是在 DMA 內容中指定。這有助於減少資料頻寬用量。DMA 引擎沒有訊號處理功能，但可以執行浮點數轉整數 (或整數轉浮點數) 的轉換。這可讓應用程式 CPU 以浮點格式處理資料樣本。

## 需求

**標頭:** shapedmacontext.h

**支援的平台:** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[SHAPE 概觀](/zh-TW/build/console-features/audio/overviews/shape-overview)\
[ShapeDmaContext](/zh-TW/reference/audio/shapedmacontext/shapedmacontext_members)


## Related topics

- [SetShapeDmaFloatSamples](/reference/audio/shapedmacontext/functions/setshapedmafloatsamples.md)
- [ShapeDmaContext](/reference/audio/shapedmacontext/shapedmacontext_members.md)
- [GetShapeDmaFloatSamples](/reference/audio/shapedmacontext/functions/getshapedmafloatsamples.md)
- [SetShapeDmaCommand](/reference/audio/shapeflowgraph/functions/setshapedmacommand.md)
- [SetShapeDmaChannel](/reference/audio/shapedmacontext/functions/setshapedmachannel.md)
