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

Cancels a hypothesis and removes its string from a text overlay.

## Syntax

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

### Parameters

*hypothesisId*   \_In\_\
Type: uint32\_t

The hypothesis ID that was returned by [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md).

### Return value

Type: HRESULT

HRESULT success or error code.

## Remarks

This function cancels a hypothesis and removes its string from the overlay.

The overlay can display only a limited number of strings. When the maximum is reached, older strings are expired. If an expired string is a hypothesis that is not yet finalized or canceled, its *hypothesisId* value becomes invalid. Passing an invalid *hypothesisId* value does not return an error.

To update a hypothesis string in the overlay, use [XSpeechToTextUpdateHypothesisString](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md).

To finalize a hypothesis, use [XSpeechToTextFinalizeHypothesisString](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md).

On some platforms, the hypothesis string is not displayed until the app calls `XSpeechToTextFinalizeHypothesisString`. Unless the hypothesis is canceled, your app must always call `XSpeechToTextFinalizeHypothesisString` to ensure that the string is displayed.

For code examples, see the [Remarks](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md#remarksSection) section of [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md).

## Requirements

**Header:** XAccessibility.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

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


## Related topics

- [XSpeechToTextUpdateHypothesisString](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md)
- [XAccessibility (API contents)](https://docs.xbox.com/reference/system/xaccessibility/xaccessibility_members.md)
- [Using C# wrappers for GDK APIs in your Unity project](https://docs.xbox.com/build/gdk-and-engines/unity/unity-api-wrappers.md)
