> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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\*](https://docs.xbox.com/zh-CN/reference/audio/shapedmacontext/structs/shape_dma_context.md)

指向 [SHAPE\_DMA\_CONTEXT](https://docs.xbox.com/zh-CN/reference/audio/shapedmacontext/structs/shape_dma_context.md) 结构的指针。

### Return value

Type: UINT32

音频缓冲区中的字节数。

## Remarks

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

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

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

有关 DMA 的更多信息,请参阅 [SHAPE 概述](https://docs.xbox.com/zh-CN/build/console-features/audio/overviews/shape-overview.md) 中的 [DMA](https://docs.xbox.com/zh-CN/build/console-features/audio/overviews/shape-overview.md#ID4EWC) 部分。

## Requirements

**头文件:** shapedmacontext.h

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

## See also

[ShapeDmaContext](https://docs.xbox.com/zh-CN/reference/audio/shapedmacontext/shapedmacontext_members.md)


## Related topics

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