XSpeechToTextFinalizeHypothesisString

Finalizes a hypothesis and updates its string in a text overlay.

Syntax

HRESULT XSpeechToTextFinalizeHypothesisString(  
         uint32_t hypothesisId,  
         const char* content  
)  

Parameters

hypothesisId   _In_
Type: uint32_t

The hypothesis ID that was returned by XSpeechToTextBeginHypothesisString.

content   _In_z_
Type: char*

The final version of the hypothesis string.

Return value

Type: HRESULT

HRESULT success or error code.

Remarks

This function finalizes a hypothesis and updates its string in place without moving it to the bottom of 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 without finalizing it, use XSpeechToTextUpdateHypothesisString.

To cancel a hypothesis and remove it from the overlay, use XSpeechToTextCancelHypothesisString.

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