Skip to main content

XSpeechToTextBeginHypothesisString

Begins a hypothesis and displays its string in a text overlay.

Syntax

Parameters

speakerName   _In_z_
Type: char*
The name of the speaker to be displayed with the hypothesis string. content   _In_z_
Type: char*
The initial hypothesis string. type   _In_
Type: XSpeechToTextType
The source type of the hypothesis string. hypothesisId   _Out_
Type: uint32_t*
The ID of the hypothesis.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

A hypothesis is a guess at what a speaker is saying, typically produced by a speech recognizer while the speaker is in mid-phrase. The speech-to-text overlay API can display a hypothesis string over a game surface. The speech-to-text overlay API also supports typed text. The type parameter identifies the source of the hypothesis string. The app is responsible for retaining the value of hypothesisId until the hypothesis is either finalized or canceled. To update a hypothesis string in the overlay, use XSpeechToTextUpdateHypothesisString. To cancel a hypothesis and remove it from the overlay, use XSpeechToTextCancelHypothesisString. 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. The following code example shows an app creating a hypothesis, updating it, and then finalizing it.
The following code example shows an app creating a hypothesis, updating it, and then canceling it.

Requirements

Header: XAccessibility.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

XAccessibility
Last modified on August 20, 2026