Partager via


XSpeechToTextCancelHypothesisString

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

Syntax

HRESULT XSpeechToTextCancelHypothesisString(  
         uint32_t hypothesisId  
)  

Parameters

hypothesisId   _In_
Type: uint32_t

The hypothesis ID that was returned by XSpeechToTextBeginHypothesisString.

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.

To finalize a hypothesis, use XSpeechToTextFinalizeHypothesisString.

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 section of XSpeechToTextBeginHypothesisString.

Requirements

Header: XAccessibility.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XAccessibility