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

# XSpeechToTextBeginHypothesisString

> XSpeechToTextBeginHypothesisString

# XSpeechToTextBeginHypothesisString

Inicia una hipótesis y muestra su cadena en una superposición de texto.

<a id="syntaxSection" />

## Sintaxis

```cpp theme={null}
HRESULT XSpeechToTextBeginHypothesisString(  
         const char* speakerName,  
         const char* content,  
         XSpeechToTextType type,  
         uint32_t* hypothesisId  
)  
```

<a id="parametersSection" />

### Parámetros

*speakerName*   \_In\_z\_\
Tipo: char\*

El nombre del hablante que se mostrará con la cadena de hipótesis.

*content*   \_In\_z\_\
Tipo: char\*

La cadena de hipótesis inicial.

*type*   \_In\_\
Tipo: [XSpeechToTextType](/reference/system/xaccessibility/enums/xspeechtotexttype)

El tipo de origen de la cadena de hipótesis.

*hypothesisId*   \_Out\_\
Tipo: uint32\_t\*

El identificador de la hipótesis.

<a id="retvalSection" />

### Valor devuelto

Tipo: HRESULT

HRESULT de operación correcta o código de error.

<a id="remarksSection" />

## Comentarios

Una hipótesis es una suposición de lo que está diciendo un hablante, generalmente producida por un reconocedor de voz mientras el hablante está a mitad de frase. La API de superposición de voz a texto puede mostrar una cadena de hipótesis sobre una superficie del juego.

La API de superposición de voz a texto también admite texto escrito. El parámetro *type* identifica el origen de la cadena de hipótesis.

La aplicación es responsable de conservar el valor de *hypothesisId* hasta que la hipótesis se finalice o se cancele.

Para actualizar una cadena de hipótesis en la superposición, use [XSpeechToTextUpdateHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring).

Para cancelar una hipótesis y quitarla de la superposición, use [XSpeechToTextCancelHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring).

Para finalizar una hipótesis, use [XSpeechToTextFinalizeHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring).

En algunas plataformas, la cadena de hipótesis no se muestra hasta que la aplicación llama a `XSpeechToTextFinalizeHypothesisString`. A menos que la hipótesis se cancele, la aplicación siempre debe llamar a `XSpeechToTextFinalizeHypothesisString` para asegurarse de que la cadena se muestre.

En el ejemplo de código siguiente se muestra una aplicación que crea una hipótesis, la actualiza y luego la finaliza.

```cpp theme={null}
void RowanHypothesisSample() 
{ 
    UINT32 hypothesisId; 
    XSpeechToTextBeginHypothesisString("Rowan", "I am typing some text.", XSpeechToTextType::Text, &hypothesisId); 
 
    // Some time passes. 
 
    XSpeechToTextUpdateHypothesisString(hypothesisId, "I am still typing some text."); 
 
    // Some time passes. 
 
    XSpeechToTextFinalizeHypothesisString(hypothesisId, "I typed some text. I am done typing."); 
} 
```

En el ejemplo de código siguiente se muestra una aplicación que crea una hipótesis, la actualiza y luego la cancela.

```cpp theme={null}
void QuincyHypothesisSample() 
{ 
    UINT32 hypothesisId; 
    XSpeechToTextBeginHypothesisString("Quincy", "I am speaking some text.", XSpeechToTextType::Voice, &hypothesisId); 
 
    // Some time passes. 
 
    XSpeechToTextUpdateHypothesisString(hypothesisId, "I am still speaking some text."); 
 
    // Some time passes. 
 
    XSpeechToTextCancelHypothesisString(hypothesisId); 
} 
```

<a id="requirementsSection" />

## Requisitos

**Encabezado:** XAccessibility.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** Windows, consolas de la familia XBOX One y consolas XBOX Series

<a id="seealsoSection" />

## Consulte también

[XAccessibility](/reference/system/xaccessibility/xaccessibility_members)


## Related topics

- [XSpeechToTextCancelHypothesisString](/es/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)
- [XSpeechToTextUpdateHypothesisString](/es/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](/es/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XAccessibility](/es/reference/system/xaccessibility/xaccessibility_members.md)
- [Contenedores de API de C# de Unity para el GDK](/es/build/gdk-and-engines/unity/unity-api-wrappers.md)
