> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XSpeechSynthesizer (API contents)

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

## Structures

| Structure | Description |
| - | - |
| [XSpeechSynthesizerVoiceInformation](https://docs.xbox.com/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md) | Provides information about a voice. |

## Enumerations

| Enumeration | Description |
| - | - |
| [XSpeechSynthesizerVoiceGender](https://docs.xbox.com/reference/system/xspeechsynthesizer/enums/xspeechsynthesizervoicegender.md) | Indicates the gender of a voice. |

## Conceptual documentation

* [Text-to-speech](https://docs.xbox.com/build/console-features/text-to-speech/text-to-speech.md)
* [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](https://docs.xbox.com/build/gdk-and-engines/unity/unity-api-wrappers.md)

## See also

[System API reference](https://docs.xbox.com/reference/system/gc-reference-system-toc.md)


## Related topics

- [XSpeechSynthesizerCreate](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [Text-to-speech](https://docs.xbox.com/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizerVoiceGender](https://docs.xbox.com/reference/system/xspeechsynthesizer/enums/xspeechsynthesizervoicegender.md)
- [XSpeechSynthesizerCloseHandle](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosehandle.md)
- [XSpeechSynthesizerVoiceInformation](https://docs.xbox.com/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md)
