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

# XSpeechSynthesizerSetDefaultVoice

Indique que le synthétiseur vocal doit utiliser la voix par défaut du système.

## Syntaxe

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

### Paramètres

*speechSynthesizer*   \_In\_\
Type : XSpeechSynthesizerHandle

Spécifie le synthétiseur vocal qui utilisera la voix par défaut.

### Valeur de retour

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

Retourne **S\_OK** en cas de réussite ; sinon, retourne un code d'erreur. Pour obtenir la liste des codes d'erreur, consultez [Codes d'erreur](https://docs.xbox.com/fr/reference/errorcodes.md).

## Remarques

> [!NOTE]
>
> Cette fonction ne peut pas être appelée sans risque sur un thread à durée critique. Pour plus d'informations, consultez [Threads à durée critique](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).

* Pour utiliser une autre voix installée pour le synthétiseur vocal spécifié, appelez [XSpeechSynthesizerSetCustomVoice](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice.md).

* Pour énumérer les voix installées sur l'appareil actuel et obtenir des informations à leur sujet, utilisez la fonction [XSpeechSynthesizerEnumerateInstalledVoices](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices.md) avec la fonction de rappel [XSpeechSynthesizerInstalledVoicesCallback](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback.md).

* Pour chaque voix installée, la structure [XSpeechSynthesizerVoiceInformation](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md) fournit l'ID de la voix, sa description, son texte d'affichage, son genre, sa langue et d'autres informations.

## Configuration requise

**En-tête :** XSpeechSynthesizer.h

**Bibliothèque :** xgameruntime.lib

**Plateformes prises en charge :** Windows, consoles de la famille XBOX One et consoles XBOX Series

## Documentation conceptuelle

* [Synthèse vocale](https://docs.xbox.com/fr/build/console-features/text-to-speech/text-to-speech.md)
* [Threads à durée critique](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Voir aussi

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


## Related topics

- [XSpeechSynthesizerSetCustomVoice](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice.md)
- [Synthèse vocale](https://docs.xbox.com/fr/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizer (contenu de l'API)](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [XSpeechSynthesizerCreate](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [Utilisation des wrappers C# pour les API GDK dans votre projet Unity](https://docs.xbox.com/fr/build/gdk-and-engines/unity/unity-api-wrappers.md)
