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

仮説を開始し、その文字列をテキスト オーバーレイに表示します。

<a id="syntaxSection" />

## 構文

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

<a id="parametersSection" />

### パラメーター

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

仮説文字列と共に表示される話者の名前です。

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

初期の仮説文字列です。

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

仮説文字列のソース タイプです。

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

仮説の ID です。

<a id="retvalSection" />

### 戻り値

型: HRESULT

HRESULT の成功またはエラー コードです。

<a id="remarksSection" />

## 解説

仮説とは、話者が発話している内容を推測したもので、通常は話者が発話の途中にある間に音声認識エンジンによって生成されます。 音声テキスト変換オーバーレイ API は、ゲーム サーフェス上に仮説文字列を表示できます。

音声テキスト変換オーバーレイ API は、入力されたテキストもサポートしています。 *type* パラメーターは仮説文字列のソースを識別します。

アプリは、仮説が確定またはキャンセルされるまで、*hypothesisId* の値を保持する必要があります。

オーバーレイの仮説文字列を更新するには、[XSpeechToTextUpdateHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring) を使用します。

仮説をキャンセルしてオーバーレイから削除するには、[XSpeechToTextCancelHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring) を使用します。

仮説を確定するには、[XSpeechToTextFinalizeHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring) を使用します。

一部のプラットフォームでは、アプリが `XSpeechToTextFinalizeHypothesisString` を呼び出すまで仮説文字列は表示されません。 仮説がキャンセルされない限り、文字列が確実に表示されるように、アプリは常に `XSpeechToTextFinalizeHypothesisString` を呼び出す必要があります。

次のコード例は、アプリが仮説を作成し、更新し、確定する方法を示しています。

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

次のコード例は、アプリが仮説を作成し、更新し、キャンセルする方法を示しています。

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

## 要件

**ヘッダー:** XAccessibility.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体、XBOX Series 本体

<a id="seealsoSection" />

## 関連項目

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


## Related topics

- [XSpeechToTextCancelHypothesisString](/ja-jp/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)
- [XSpeechToTextUpdateHypothesisString](/ja-jp/reference/system/xaccessibility/functions/xspeechtotextupdatehypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](/ja-jp/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XAccessibility](/ja-jp/reference/system/xaccessibility/xaccessibility_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
