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

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

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

La 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-CA/reference/errorcodes).

## Remarques

<Note>Cette fonction ne peut pas être appelée en toute sécurité sur un thread à délai critique. Pour plus d'informations, consultez [Threads à délai 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-CA/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 de cette fonction pour définir la valeur du paramètre *bufferSize* de la fonction [XSpeechSynthesizerGetStreamData](/fr-CA/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata).

* Pour obtenir un exemple qui montre comment utiliser la fonction **XSpeechSynthesizerGetStreamDataSize**, consultez [XSpeechSynthesizerCreate](/fr-CA/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-CA/build/console-features/text-to-speech/text-to-speech)
* [Threads à délai critique](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Voir aussi

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


## Related topics

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