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

# GetXmaBlockContainingSample

> GetXmaBlockContainingSample

# GetXmaBlockContainingSample

使用指定的查找表找到包含指定已解码采样的 XBOX Media Audio (XMA) 块。XMA 文件中的查找表条目以大端序形式存储，有时在调用此函数之前需要进行转换。

## 语法

```cpp theme={null}
HRESULT GetXmaBlockContainingSample(  
         DWORD nBlockCount,  
         const DWORD* pSeekTable,  
         DWORD nDesiredSample,  
         DWORD* pnBlockContainingSample,  
         DWORD* pnSampleOffsetWithinBlock  
)  
```

### 参数

*nBlockCount*   \
类型：DWORD

文件中的块数。与查找表中的条目数相同。

*pSeekTable*   \_In\_count\_(nBlockCount)\
类型：DWORD\*

指向查找表数据的指针。

*nDesiredSample*   \
类型：DWORD

要定位的已解码采样。

*pnBlockContainingSample*   \_Out\_\
类型：DWORD\*

包含该采样的块的索引。

*pnSampleOffsetWithinBlock*   \_Out\_\
类型：DWORD\*

该采样在此块中的位置。

### 返回值

类型：HRESULT

成功 `S_OK` 或错误 `E_FAIL` 代码。

## 备注

此函数使用 `pSeekTable` 指针找到包含给定已解码采样的 XMA 块。XMA 文件中的查找表条目以大端序形式存储。

<Note>调用此函数之前，可能需要转换查找表条目。</Note>

有关 XMA2 的详细信息，请参阅 [XMA2 概述](/build/console-features/audio/overviews/xma2-overview)。有关 XBOX One 音频架构的概述，请参阅**未来之声**：[XBOX One 中的音频架构](/build/console-features/audio/overviews/xbox-one-audio-architecture)。

## 要求

**头文件：** xma2defs.h

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

## 另请参阅

[xma2defs](/reference/audio/xma2defs/xma2defs_members)


## Related topics

- [XMA2Defs](/zh-CN/reference/audio/xma2defs/xma2defs_members.md)
- [GetXmaSampleRate](/zh-CN/reference/audio/xma2defs/functions/getxmasamplerate.md)
- [SHAPE_XMA_SAMPLE_RATE](/zh-CN/reference/audio/shapexmacontext/enums/shape_xma_sample_rate.md)
- [GetShapeXmaSampleRate](/zh-CN/reference/audio/shapexmacontext/functions/getshapexmasamplerate.md)
- [GetXmaDecodePositionForSample](/zh-CN/reference/audio/xma2defs/functions/getxmadecodepositionforsample.md)
