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

Displays text on the Game title screen.

## Syntax

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

### Parameters

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

The name of the speaker that is the source of the text.

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

The text to display on the Game title screen.

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

An enumeration value representing the source type of the text: transcribed game voice chat, in-game speech subtitles, in-game text reading, or in-game text chat. The game title uses the value of the *type* parameter to display either a microphone icon or a keyboard next to the text on the game screen.

### Return value

Type: HRESULT

HRESULT if successful.  Otherwise, returns an error code.\
For a list of error codes, see [Error Codes](/reference/errorcodes).

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

For this function to be successful, closed captions must be enabled.
The user must enable the closed captions feature in the UI of the Game title.
If the user enabled closed captions, your Game title can flag the status of closed captions by calling [XClosedCaptionSetEnabled](/reference/system/xaccessibility/functions/xclosedcaptionsetenabled).

The following example demonstrates how to display text on the speech-to-text window.

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

## Requirements

**Header:** XAccessibility.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

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

## See also

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

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

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


## Related topics

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