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

Recupera los datos de una secuencia de síntesis de voz.

## Sintaxis

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

### Parámetros

*speechSynthesisStream*   \_In\_\
Tipo: XSpeechSynthesizerStreamHandle

La secuencia de síntesis de voz que contiene el búfer de datos.

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

El tamaño del búfer, en bytes, devuelto por [XSpeechSynthesizerGetStreamDataSize](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md).

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

Un puntero al búfer de datos que recibirá los datos.

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

El tamaño de los datos recibidos en *buffer*, en bytes.

### Valor devuelto

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

Devuelve **S\_OK** si se ejecuta correctamente; de lo contrario, devuelve un código de error. Para obtener una lista de códigos de error, consulte [Códigos de error](https://docs.xbox.com/es/reference/errorcodes.md). Si la función falla porque *speechSynthesisStream* no está establecido en un identificador de secuencia de sintetizador de voz válido, el valor devuelto se establece en **HRESULT\_FROM\_WIN32(ERROR\_NOT\_FOUND)**.

## Comentarios

> [!NOTE]
>
> No es seguro llamar a esta función en un subproceso sensible al tiempo. Para obtener más información, consulte [Subprocesos sensibles al tiempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).

Use esta función para recuperar los datos de audio de la voz sintetizada, desde el búfer de datos de una secuencia de sintetizador de voz creada mediante una llamada a la función [XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md). Los datos de audio se devuelven en el formato de contenedor WAVE (tipo MIME `audio/wav`).

Para ver un ejemplo que muestra cómo usar la función **XSpeechSynthesizerGetStreamData**, consulte [XSpeechSynthesizerCreate](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md).

## Requisitos

**Encabezado:** XSpeechSynthesizer.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** Windows, consolas de la familia XBOX One y consolas XBOX Series

## Documentación conceptual

* [Texto a voz](https://docs.xbox.com/es/build/console-features/text-to-speech/text-to-speech.md)
* [Subprocesos sensibles al tiempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Consulte también

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


## Related topics

- [XSpeechSynthesizerGetStreamDataSize](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize.md)
- [XSpeechSynthesizerCreate](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [Texto a voz](https://docs.xbox.com/es/build/console-features/text-to-speech/text-to-speech.md)
- [XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)
- [XSpeechSynthesizerCreateStreamFromSsml](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromssml.md)
