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

# GetShapeDmaNumBytes

> GetShapeDmaNumBytes

# GetShapeDmaNumBytes

获取音频缓冲区中的字节数。

## Syntax

```cpp theme={null}
UINT32 GetShapeDmaNumBytes(  
         const SHAPE_DMA_CONTEXT* context  
)  
```

### Parameters

*context*   \_In\_\
Type: [SHAPE\_DMA\_CONTEXT\*](/reference/audio/shapedmacontext/structs/shape_dma_context)

指向 [SHAPE\_DMA\_CONTEXT](/reference/audio/shapedmacontext/structs/shape_dma_context) 结构的指针。

### Return value

Type: UINT32

音频缓冲区中的字节数。

## Remarks

直接内存访问 (DMA) 缓冲区的完整大小(以字节为单位)按以下方式计算:

```cpp theme={null}
fullBufferSizeInBytes = 128 * 4 * numChannels * numFrames  
```

DMA 缓冲区是循环缓冲区,包含以 128 个采样为一块的去交错采样。每个采样是 32 位浮点数或 32 位有符号整数。

有关 DMA 的更多信息,请参阅 [SHAPE 概述](/build/console-features/audio/overviews/shape-overview) 中的 [DMA](/build/console-features/audio/overviews/shape-overview#ID4EWC) 部分。

## Requirements

**头文件:** shapedmacontext.h

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

## See also

[ShapeDmaContext](/reference/audio/shapedmacontext/shapedmacontext_members)


## Related topics

- [ShapeDmaContext](/zh-CN/reference/audio/shapedmacontext/shapedmacontext_members.md)
- [GetShapeDmaNumChannels](/zh-CN/reference/audio/shapedmacontext/functions/getshapedmanumchannels.md)
- [GetShapeDmaNumFrames](/zh-CN/reference/audio/shapedmacontext/functions/getshapedmanumframes.md)
- [GetShapeDmaBytesPerFrame](/zh-CN/reference/audio/shapedmacontext/functions/getshapedmabytesperframe.md)
- [GetShapeXmaOutputBufferNumBytesAvailable](/zh-CN/reference/audio/shapexmacontext/functions/getshapexmaoutputbuffernumbytesavailable.md)
