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

Nom de l'orateur à afficher avec la chaîne d'hypothèse.

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

Chaîne d'hypothèse initiale.

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

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

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

ID de l'hypothèse.

<a id="retvalSection" />

### Valeur de retour

Type : HRESULT

HRESULT de réussite ou code d'erreur.

<a id="remarksSection" />

## Remarques

Une hypothèse est une estimation de ce que dit un orateur, généralement produite par un module de reconnaissance vocale pendant que l'orateur 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 saisi. Le paramètre *type* identifie la source de la chaîne d'hypothèse.

L'application est chargée 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/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring).

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

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

Sur certaines plateformes, la chaîne d'hypothèse n'est pas affichée tant que l'application n'a pas appelé `XSpeechToTextFinalizeHypothesisString`. Sauf si l'hypothèse est annulée, votre application doit toujours appeler `XSpeechToTextFinalizeHypothesisString` pour garantir l'affichage de la chaîne.

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/reference/system/xaccessibility/xaccessibility_members)


## Related topics

- [XSpeechToTextCancelHypothesisString](/fr/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)
- [XSpeechToTextUpdateHypothesisString](/fr/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](/fr/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XAccessibility](/fr/reference/system/xaccessibility/xaccessibility_members.md)
- [Wrappers d'API C# Unity pour le GDK](/fr/build/gdk-and-engines/unity/unity-api-wrappers.md)
