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

# XSpeechSynthesizerCloseStreamHandle

> XSpeechSynthesizerCloseStreamHandle

# XSpeechSynthesizerCloseStreamHandle

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

## Syntaxe

```cpp theme={null}
HRESULT XSpeechSynthesizerCloseStreamHandle(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream  
)  
```

### Paramètres

*speechSynthesisStream*   \_In\_\
Type : XSpeechSynthesizerStreamHandle

Flux de synthèse vocale à 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 flux de synthétiseur vocal créé en appelant la fonction [XSpeechSynthesizerCreateStreamFromText](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext).

Pour éviter les fuites de mémoire, appelez cette fonction pour fermer un handle de flux de synthétiseur vocal une fois que vous avez terminé toutes les opérations qui utilisent ce handle. Toutes les opérations asynchrones en attente doivent être terminées avant l'appel de cette fonction.

Pour obtenir un exemple illustrant l'utilisation de la fonction **XSpeechSynthesizerCloseStreamHandle**, 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)\
[XSpeechSynthesizerCloseHandle](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosehandle)\
[XSpeechSynthesizer](/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

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