> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md).

*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](https://docs.xbox.com/fr/reference/errorcodes.md). 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).

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](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md). 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](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md).

## 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](https://docs.xbox.com/fr/build/console-features/text-to-speech/text-to-speech.md)
* [Threads à durée critique](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Voir aussi

[XAccessibility](https://docs.xbox.com/fr/reference/system/xaccessibility/xaccessibility_members.md)\
[XSpeechSynthesizerGetStreamDataSize](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md)\
[XSpeechSynthesizer](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizerGetStreamDataSize](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md)
- [Synthèse vocale](https://docs.xbox.com/fr/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizerCreate](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [XSpeechSynthesizerCreateStreamFromSsml](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
- [XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)
