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

# 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](/fr/reference/errorcodes).

## 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 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](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext). 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](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata).

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

[XSpeechSynthesizerCreateStreamFromText](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext)\
[XSpeechSynthesizerGetStreamData](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata)\
[XSpeechSynthesizer](/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerGetStreamData](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata.md)
- [XSpeechSynthesizer](/fr/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [Synthèse vocale](/fr/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizerCreate](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [XSpeechSynthesizerCreateStreamFromSsml](/fr/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
