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

# XSpeechSynthesizerGetStreamDataSize

> XSpeechSynthesizerGetStreamDataSize

# XSpeechSynthesizerGetStreamDataSize

Obtient la taille de la mémoire tampon de données d'un flux de synthèse vocale.

## Syntaxe

```cpp theme={null}
HRESULT XSpeechSynthesizerGetStreamDataSize(  
         XSpeechSynthesizerStreamHandle speechSynthesisStream,  
         size_t* bufferSize  
)  
```

### Paramètres

*speechSynthesisStream*   \_In\_\
Type : XSpeechSynthesizerStreamHandle

Flux de synthétiseur vocal qui contient les données du flux.

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

Taille de la mémoire tampon des données du flux, 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).

## 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 déterminer la taille de la mémoire tampon nécessaire 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). La taille maximale des données de la mémoire tampon est de 0xffffffff octets : quatre gigaoctets moins un octet.

* Pour récupérer les données audio d'un flux de synthétiseur vocal, utilisez la valeur retournée par cette fonction pour définir la valeur du paramètre *bufferSize* de la fonction [XSpeechSynthesizerGetStreamData](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.md).

* Pour obtenir un exemple illustrant l'utilisation de la fonction **XSpeechSynthesizerGetStreamDataSize**, 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

[XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)\
[XSpeechSynthesizerGetStreamData](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.md)\
[XSpeechSynthesizer](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizerGetStreamData](https://docs.xbox.com/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.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)
