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

# XSpeechToTextCancelHypothesisString

> XSpeechToTextCancelHypothesisString

# XSpeechToTextCancelHypothesisString

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

<a id="syntaxSection" />

## 語法

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

<a id="parametersSection" />

### 參數

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

[XSpeechToTextBeginHypothesisString](/zh-TW/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring) 所傳回的假設識別碼。

<a id="retvalSection" />

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

<a id="remarksSection" />

## 備註

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

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

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

若要完成假設，請使用 [XSpeechToTextFinalizeHypothesisString](/zh-TW/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring)。

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

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

<a id="requirementsSection" />

## 需求

**標頭：** XAccessibility.h

**程式庫：** xgameruntime.lib

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

<a id="seealsoSection" />

## 另請參閱

[XAccessibility](/zh-TW/reference/system/xaccessibility/xaccessibility_members)


## Related topics

- [XSpeechToTextUpdateHypothesisString](/zh-TW/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](/zh-TW/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XSpeechToTextBeginHypothesisString](/zh-TW/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md)
- [XAccessibility](/zh-TW/reference/system/xaccessibility/xaccessibility_members.md)
- [適用於 GDK 的 Unity C# API 包裝函式](/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
