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

# XSpeechToTextCancelHypothesisString

> XSpeechToTextCancelHypothesisString

# XSpeechToTextCancelHypothesisString

取消假設，並從文字覆疊中移除其字串。

## 語法

```cpp theme={null}
HRESULT XSpeechToTextCancelHypothesisString(  
         uint32_t hypothesisId  
)  
```

### 參數

*hypothesisId*   \_In\_\
類型：uint32\_t

[XSpeechToTextBeginHypothesisString](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md) 所傳回的假設識別碼。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

## 備註

此函式會取消假設，並從覆疊中移除其字串。

覆疊只能顯示有限數量的字串。達到上限時，較舊的字串會過期。如果過期的字串是尚未完成或取消的假設，其 *hypothesisId* 值會變成無效。傳遞無效的 *hypothesisId* 值不會傳回錯誤。

若要更新覆疊中的假設字串，請使用 [XSpeechToTextUpdateHypothesisString](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)。

若要完成假設，請使用 [XSpeechToTextFinalizeHypothesisString](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)。

在某些平台上，必須等到應用程式呼叫 `XSpeechToTextFinalizeHypothesisString` 之後，才會顯示假設字串。除非假設已取消，否則您的應用程式一律必須呼叫 `XSpeechToTextFinalizeHypothesisString`，以確保字串會顯示。

如需程式碼範例，請參閱 [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md) 的[備註](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md#remarksSection)一節。

## 需求

**標頭：** XAccessibility.h

**程式庫：** xgameruntime.lib

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

## 另請參閱

[XAccessibility](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/xaccessibility_members.md)


## Related topics

- [XSpeechToTextUpdateHypothesisString](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md)
- [XAccessibility (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xaccessibility/xaccessibility_members.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
