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

# XSpeechToTextSendString

> XSpeechToTextSendString

# XSpeechToTextSendString

ゲーム タイトル画面にテキストを表示します。

## 構文

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

### パラメーター

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

テキストのソースとなる話者の名前です。

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

ゲーム タイトル画面に表示するテキストです。

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

テキストのソース タイプ (書き起こされたゲーム ボイス チャット、ゲーム内音声字幕、ゲーム内テキストの読み上げ、またはゲーム内テキスト チャット) を表す列挙値です。 ゲーム タイトルは、*type* パラメーターの値を使用して、ゲーム画面上のテキストの横にマイク アイコンまたはキーボード アイコンを表示します。

### 戻り値

型: HRESULT

成功した場合は HRESULT。 それ以外の場合はエラー コードを返します。\
エラー コードの一覧については、「[エラー コード](/reference/errorcodes)」を参照してください。

## 解説

<Note>この関数は、時間依存スレッドで呼び出しても安全ではありません。 詳細については、「[Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)」を参照してください。</Note>

この関数を成功させるには、クローズド キャプションを有効にする必要があります。
ユーザーがゲーム タイトルの UI でクローズド キャプション機能を有効にする必要があります。
ユーザーがクローズド キャプションを有効にした場合、ゲーム タイトルは [XClosedCaptionSetEnabled](/reference/system/xaccessibility/functions/xclosedcaptionsetenabled) を呼び出すことでクローズド キャプションのステータスをフラグとして設定できます。

次の例は、音声テキスト変換ウィンドウにテキストを表示する方法を示しています。

```cpp theme={null}
auto hr = XSpeechToTextSendString("Sandy", "This is my text.", XSpeechToTextType::Text);
)  
```

## 要件

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

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

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

## 概念ドキュメント

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 関連項目

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

[XSpeechToTextType](/reference/system/xaccessibility/enums/xspeechtotexttype)

[XClosedCaptionSetEnabled](/reference/system/xaccessibility/functions/xclosedcaptionsetenabled)


## Related topics

- [XSpeechToTextType](/ja-jp/reference/system/xaccessibility/enums/xspeechtotexttype.md)
- [XSpeechToTextPositionHint](/ja-jp/reference/system/xaccessibility/enums/xspeechtotextpositionhint.md)
- [XAccessibility](/ja-jp/reference/system/xaccessibility/xaccessibility_members.md)
- [XSpeechToTextBeginHypothesisString](/ja-jp/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md)
- [XSpeechToTextCancelHypothesisString](/ja-jp/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)
