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

Commence une hypothèse et affiche sa chaîne dans une superposition de texte.

<a id="syntaxSection" />

## Syntaxe

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

<a id="parametersSection" />

### Paramètres

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

Le nom de l'interlocuteur à afficher avec la chaîne d'hypothèse.

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

La chaîne d'hypothèse initiale.

*type*   \_In\_\
Type : [XSpeechToTextType](/fr-CA/reference/system/xaccessibility/enums/xspeechtotexttype)

Le type de source de la chaîne d'hypothèse.

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

L'identificateur de l'hypothèse.

<a id="retvalSection" />

### Valeur de retour

Type : HRESULT

Code HRESULT de réussite ou d'erreur.

<a id="remarksSection" />

## Remarques

Une hypothèse est une estimation de ce que dit un interlocuteur, généralement produite par un module de reconnaissance vocale pendant que l'interlocuteur est au milieu d'une phrase. L'API de superposition de reconnaissance vocale peut afficher une chaîne d'hypothèse par-dessus une surface de jeu.

L'API de superposition de reconnaissance vocale prend également en charge le texte tapé. Le paramètre *type* identifie la source de la chaîne d'hypothèse.

L'application est responsable de conserver la valeur de *hypothesisId* jusqu'à ce que l'hypothèse soit finalisée ou annulée.

Pour mettre à jour une chaîne d'hypothèse dans la superposition, utilisez [XSpeechToTextUpdateHypothesisString](/fr-CA/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring).

Pour annuler une hypothèse et la retirer de la superposition, utilisez [XSpeechToTextCancelHypothesisString](/fr-CA/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring).

Pour finaliser une hypothèse, utilisez [XSpeechToTextFinalizeHypothesisString](/fr-CA/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring).

Sur certaines plateformes, la chaîne d'hypothèse n'est pas affichée tant que l'application n'appelle pas `XSpeechToTextFinalizeHypothesisString`. À moins que l'hypothèse ne soit annulée, votre application doit toujours appeler `XSpeechToTextFinalizeHypothesisString` pour s'assurer que la chaîne est affichée.

L'exemple de code suivant montre une application qui crée une hypothèse, la met à jour, puis la finalise.

```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."); 
} 
```

L'exemple de code suivant montre une application qui crée une hypothèse, la met à jour, puis l'annule.

```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" />

## Configuration requise

**En-tête :** XAccessibility.h

**Bibliothèque :** xgameruntime.lib

**Plateformes prises en charge :** Windows, consoles de la famille XBOX One et consoles XBOX Series

<a id="seealsoSection" />

## Voir aussi

[XAccessibility](/fr-CA/reference/system/xaccessibility/xaccessibility_members)


## Related topics

- [XSpeechToTextBeginHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md)
- [XSpeechToTextCancelHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)
- [XSpeechToTextUpdateHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
