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

Le 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-CA/reference/errorcodes).

## Remarques

<Note>Il n'est pas sécuritaire 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-CA/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 un exemple montrant comment utiliser la fonction **XSpeechSynthesizerCloseHandle**, consultez [XSpeechSynthesizerCreate](/fr-CA/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-CA/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-CA/reference/system/xaccessibility/xaccessibility_members)\
[XSpeechSynthesizerCreate](/fr-CA/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate)\
[XSpeechSynthesizerCloseStreamHandle](/fr-CA/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle)\
[XSpeechSynthesizer](/fr-CA/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerCloseHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosehandle.md)
- [XSpeechSynthesizerCloseStreamHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle.md)
