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

# XSpeechSynthesizerSetDefaultVoice

> XSpeechSynthesizerSetDefaultVoice

Specifies that the speech synthesizer is to use the system's default voice.

## Syntax

```cpp theme={null}
HRESULT XSpeechSynthesizerSetDefaultVoice(  
         XSpeechSynthesizerHandle speechSynthesizer  
)  
```

### Parameters

*speechSynthesizer*   \_In\_\
Type: XSpeechSynthesizerHandle

Specifies the speech synthesizer that will be using the default voice.

### Return value

Type: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

Returns **S\_OK** if successful; otherwise, returns an error code. For a list of error codes, see [Error Codes](https://docs.xbox.com/reference/errorcodes.md).

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

* To use a different installed voice for the specified speech synthesizer, call [XSpeechSynthesizerSetCustomVoice](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice.md).

* To enumerate over and get information about the voices installed on the current device, use the [XSpeechSynthesizerEnumerateInstalledVoices](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices.md) function along with the [XSpeechSynthesizerInstalledVoicesCallback](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback.md) callback function.

* For each installed voice, the [XSpeechSynthesizerVoiceInformation](https://docs.xbox.com/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md) structure provides the voice ID, description, display text, gender, language, and other information.

## Requirements

**Header:** XSpeechSynthesizer.h

**Library:** xgameruntime.lib

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

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

## See also

[XAccessibility](https://docs.xbox.com/reference/system/xaccessibility/xaccessibility_members.md)\
[XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)\
[XSpeechSynthesizer](https://docs.xbox.com/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizerSetCustomVoice](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice.md)
- [Text-to-speech](https://docs.xbox.com/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizer (API contents)](https://docs.xbox.com/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [XSpeechSynthesizerCreate](https://docs.xbox.com/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [Using C# wrappers for GDK APIs in your Unity project](https://docs.xbox.com/build/gdk-and-engines/unity/unity-api-wrappers.md)
