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

# 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](/fr/reference/errorcodes).

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

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

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

* Pour chaque voix installée, la structure [XSpeechSynthesizerVoiceInformation](/fr/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation) 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](/fr/build/console-features/text-to-speech/text-to-speech)
* [Threads à durée critique](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Voir aussi

[XAccessibility](/fr/reference/system/xaccessibility/xaccessibility_members)\
[XSpeechSynthesizerCreateStreamFromText](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext)\
[XSpeechSynthesizer](/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerSetDefaultVoice](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetdefaultvoice.md)
- [XSpeechSynthesizerSetCustomVoice](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetcustomvoice.md)
- [XSpeechSynthesizer](/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
