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

# XSpeechSynthesizerGetStreamData

> XSpeechSynthesizerGetStreamData

# XSpeechSynthesizerGetStreamData

Récupère les données d'un flux de synthèse vocale.

## Syntaxe

```cpp theme={null}
HRESULT XSpeechSynthesizerGetStreamData(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream,  
         size_t bufferSize,  
         void* buffer,  
         size_t* bufferUsed  
)  
```

### Paramètres

*speechSynthesisStream*   \_In\_\
Type : XSpeechSynthesizerStreamHandle

Flux de synthèse vocale qui contient la mémoire tampon de données.

*bufferSize*   \_In\_\
Type : size\_t

Taille de la mémoire tampon, en octets, retournée par [XSpeechSynthesizerGetStreamDataSize](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize).

*buffer*   \_Out\_writes\_to\_(bufferSize,*bufferUsed)\
Type : void*

Pointeur vers la mémoire tampon de données qui recevra les données.

*bufferUsed*   \_Out\_opt\_\
Type : size\_t\*

Taille des données reçues dans *buffer*, en octets.

### 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). Si la fonction échoue parce que *speechSynthesisStream* n'est pas défini sur un handle de flux de synthétiseur vocal valide, la valeur de retour est **HRESULT\_FROM\_WIN32(ERROR\_NOT\_FOUND)**.

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

Utilisez cette fonction pour récupérer les données audio de la parole synthétisée, à partir de la mémoire tampon de données d'un flux de synthétiseur vocal créé en appelant la fonction [XSpeechSynthesizerCreateStreamFromText](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext). Les données audio sont retournées au format de conteneur WAVE (type MIME `audio/wav`).

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


## Related topics

- [XSpeechSynthesizerGetStreamData](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.md)
- [XSpeechSynthesizerGetStreamDataSize](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md)
