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

# XSpeechSynthesizerCloseHandle

> XSpeechSynthesizerCloseHandle

# XSpeechSynthesizerCloseHandle

Ferme le synthétiseur vocal et libère les ressources système allouées.

## Syntaxe

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

### Paramètres

*speechSynthesizer*   \_In\_opt\_\
Type : XSpeechSynthesizerHandle

Synthétiseur vocal à fermer.

### 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>Il n'est pas sûr d'appeler cette fonction sur un thread sensible au temps. Pour plus d'informations, consultez [Threads sensibles au temps](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

* Utilisez cette fonction pour fermer un synthétiseur vocal créé en appelant la fonction [XSpeechSynthesizerCreate](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate).

* Pour éviter les fuites de mémoire, appelez cette fonction pour fermer un handle de synthétiseur vocal une fois que vous avez terminé toutes les opérations qui utilisent ce handle.

* Pour obtenir un exemple illustrant l'utilisation de la fonction **XSpeechSynthesizerCloseHandle**, consultez [XSpeechSynthesizerCreate](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate).

## 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 sensibles au temps](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)\
[XSpeechSynthesizerCreate](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate)\
[XSpeechSynthesizerCloseStreamHandle](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle)\
[XSpeechSynthesizer](/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerCloseStreamHandle](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle.md)
- [XSpeechSynthesizerCreate](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [XSpeechSynthesizer](/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [Wrappers d'API C# Unity pour le GDK](/fr/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XSpeechSynthesizerCreateStreamFromSsml](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
