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

# XSpeechSynthesizer

> XSpeechSynthesizer

# XSpeechSynthesizer

Provides support for initializing and configuring a speech synthesis engine, or *voice*, for converting a text string into an audio stream. This functionality is also known as text-to-speech (TTS).

## Functions

| Function                                                                                                                                | Description                                                                                                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [XSpeechSynthesizerCloseHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosehandle)                           | Closes the speech synthesizer and releases allocated system resources.                                                                                                                                                                   |
| [XSpeechSynthesizerCloseStreamHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle)               | Closes the speech synthesizer stream and releases allocated system resources.                                                                                                                                                            |
| [XSpeechSynthesizerCreate](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate)                                     | Creates a speech synthesizer.                                                                                                                                                                                                            |
| [XSpeechSynthesizerCreateStreamFromSsml](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml)         | Creates a speech synthesis stream from the specified SSML.                                                                                                                                                                               |
| [XSpeechSynthesizerCreateStreamFromText](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext)         | Creates a speech synthesis stream from the specified plain text.                                                                                                                                                                         |
| [XSpeechSynthesizerEnumerateInstalledVoices](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices) | Enumerates the installed voices, and calls the method pointed to by *callback* for each voice.                                                                                                                                           |
| [XSpeechSynthesizerGetStreamData](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata)                       | Retrieves the data from a speech synthesis stream.                                                                                                                                                                                       |
| [XSpeechSynthesizerGetStreamDataSize](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize)               | Gets the size of the data buffer from a speech synthesis stream.                                                                                                                                                                         |
| [XSpeechSynthesizerInstalledVoicesCallback](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback)   | The client-implemented callback function that receives information about a voice when [XSpeechSynthesizerEnumerateInstalledVoices](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices) is called. |
| [XSpeechSynthesizerSetCustomVoice](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice)                     | Specifies that the speech synthesizer is to use the specified custom voice.                                                                                                                                                              |
| [XSpeechSynthesizerSetDefaultVoice](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetdefaultvoice)                   | Specifies that the speech synthesizer is to use the system's default voice.                                                                                                                                                              |

## Structures

| Structure                                                                                                             | Description                         |
| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| [XSpeechSynthesizerVoiceInformation](/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation) | Provides information about a voice. |

## Enumerations

| Enumeration                                                                                               | Description                      |
| --------------------------------------------------------------------------------------------------------- | -------------------------------- |
| [XSpeechSynthesizerVoiceGender](/reference/system/xspeechsynthesizer/enums/xspeechsynthesizervoicegender) | Indicates the gender of a voice. |

## Conceptual documentation

* [Text-to-speech](/build/console-features/text-to-speech/text-to-speech)
* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)
* [Using C# wrappers for GDK APIs in your Unity project](/build/gdk-and-engines/unity/unity-api-wrappers)

## See also

[System API reference](/reference/system/gc-reference-system-toc)


## Related topics

- [XSpeechSynthesizerCreate](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [XSpeechSynthesizerVoiceGender](/reference/system/xspeechsynthesizer/enums/xspeechsynthesizervoicegender.md)
- [XSpeechSynthesizerCloseHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosehandle.md)
- [XSpeechSynthesizerVoiceInformation](/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md)
- [XSpeechSynthesizerCreateStreamFromSsml](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
