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

Recupera os dados de um fluxo de síntese de fala.

## Sintaxe

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

### Parâmetros

*speechSynthesisStream*   \_In\_\
Tipo: XSpeechSynthesizerStreamHandle

O fluxo de síntese de fala que contém o buffer de dados.

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

O tamanho do buffer, em bytes, retornado por [XSpeechSynthesizerGetStreamDataSize](/pt-BR/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize).

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

Um ponteiro para o buffer de dados que receberá os dados.

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

O tamanho dos dados recebidos em *buffer*, em bytes.

### Valor retornado

Tipo: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

Retornará **S\_OK** se for bem-sucedido; caso contrário, retornará um código de erro. Para obter uma lista de códigos de erro, consulte [Códigos de erro](/pt-BR/reference/errorcodes). Se a função falhar porque *speechSynthesisStream* não está definido como um identificador de fluxo de sintetizador de fala válido, o valor retornado será definido como **HRESULT\_FROM\_WIN32(ERROR\_NOT\_FOUND)**.

## Comentários

<Note>Não é seguro chamar esta função em um thread sensível ao tempo. Para obter mais informações, consulte [Threads sensíveis ao tempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

Use esta função para recuperar os dados de áudio da fala sintetizada, do buffer de dados de um fluxo de sintetizador de fala criado chamando a função [XSpeechSynthesizerCreateStreamFromText](/pt-BR/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext). Os dados de áudio são retornados no formato de contêiner WAVE (tipo MIME `audio/wav`).

Para obter um exemplo que demonstra como usar a função **XSpeechSynthesizerGetStreamData**, consulte [XSpeechSynthesizerCreate](/pt-BR/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate).

## Requisitos

**Cabeçalho:** XSpeechSynthesizer.h

**Biblioteca:** xgameruntime.lib

**Plataformas com suporte:** Windows, consoles da família XBOX One e consoles XBOX Series

## Documentação conceitual

* [Conversão de texto em fala](/pt-BR/build/console-features/text-to-speech/text-to-speech)
* [Threads sensíveis ao tempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Confira também

[XAccessibility](/pt-BR/reference/system/xaccessibility/xaccessibility_members)\
[XSpeechSynthesizerGetStreamDataSize](/pt-BR/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize)\
[XSpeechSynthesizer](/pt-BR/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

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