> ## 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 檔案中的搜尋表項目是以 big-endian 格式儲存，有時需要在呼叫此函式之前先進行轉換。

## 語法

```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 檔案中的搜尋表項目是以 big-endian 格式儲存。

<Note>在呼叫此函式之前，可能需要先轉換搜尋表項目。</Note>

如需 XMA2 的詳細資訊，請參閱 [XMA2 概觀](/zh-TW/build/console-features/audio/overviews/xma2-overview)。如需 XBOX One 音訊架構的概觀，請參閱**未來之聲**：[XBOX One 的音訊架構](/zh-TW/build/console-features/audio/overviews/xbox-one-audio-architecture)。

## 需求

**標頭：** xma2defs.h

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

## 另請參閱

[xma2defs](/zh-TW/reference/audio/xma2defs/xma2defs_members)


## Related topics

- [GetXmaBlockContainingSample](/reference/audio/xma2defs/functions/getxmablockcontainingsample.md)
- [XMA2Defs](/reference/audio/xma2defs/xma2defs_members.md)
