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

# XSpeechSynthesizerCreateStreamFromSsml

> XSpeechSynthesizerCreateStreamFromSsml

# XSpeechSynthesizerCreateStreamFromSsml

Crea una secuencia de síntesis de voz a partir del SSML especificado.

## Sintaxis

```cpp theme={null}
HRESULT XSpeechSynthesizerCreateStreamFromSsml(  
         XSpeechSynthesizerHandle speechSynthesizer,  
         const char* ssml,  
         XSpeechSynthesizerStreamHandle* speechSynthesisStream  
)  
```

### Parámetros

*speechSynthesizer*   \_In\_\
Tipo: XSpeechSynthesizerHandle

El sintetizador de voz que se usará.

*ssml*   \_In\_z\_\
Tipo: char\*

El texto modificado con SSML que se pronunciará. Para obtener más información sobre el marcado SSML, consulte las [recomendaciones del W3C](https://go.microsoft.com/fwlink/p/?LinkID=201763).

<Note>Esta API requiere que los autores de llamadas usen la versión 1.0 de SSML.</Note>

*speechSynthesisStream*   \_Out\_\
Tipo: XSpeechSynthesizerStreamHandle\*

Una secuencia de síntesis de voz que representa la voz generada a partir del texto sin formato especificado en *text*.

### Valor devuelto

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

Devuelve **S\_OK** si se realiza correctamente; de lo contrario, devuelve un código de error. Para obtener una lista de códigos de error, consulte [Códigos de error](/reference/errorcodes). Si la función produce un error porque la secuencia del sintetizador de voz es mayor que el tamaño máximo de datos, el valor devuelto se establece en **E\_BOUNDS**.

## 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).</Note>

* Use esta función para sintetizar voz a partir de texto sin formato y para generar datos de audio en el formato de contenedor WAVE (tipo MIME `audio/wav`). Después de usar esta función para crear una secuencia de sintetizador de voz y sintetizar voz a partir de texto sin formato, use las funciones [XSpeechSynthesizerGetStreamDataSize](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdatasize) y [XSpeechSynthesizerGetStreamData](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizergetstreamdata) para recuperar los datos de audio de la secuencia del sintetizador de voz. Use la función [XSpeechSynthesizerCloseStreamHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle) para cerrar la secuencia del sintetizador de voz después de haber recuperado los datos de audio.

* El tamaño máximo de datos de una secuencia de sintetizador de voz es 0xffffffff bytes: cuatro gigabytes menos un byte. Se produce un error si intenta crear una secuencia de sintetizador de voz mayor que el tamaño máximo de datos.

* Para evitar pérdidas de memoria, llame a la función [XSpeechSynthesizerCloseStreamHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle) para cerrar un identificador de secuencia de sintetizador de voz después de haber completado todas las operaciones que usan el identificador. Todas las operaciones asincrónicas pendientes deben completarse antes de llamar a esta función.

* Para ver un ejemplo que muestra cómo usar la función **XSpeechSynthesizerCreateStreamFromSsml**, consulte [XSpeechSynthesizerCreate](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate).

## Requisitos

**Encabezado:** XSpeechSynthesizer.h

**Biblioteca:** xgameruntime.lib

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

## Consulte también

[XAccessibility](/reference/system/xaccessibility/xaccessibility_members)\
[XSpeechSynthesizerCloseStreamHandle](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerclosestreamhandle)\
[XSpeechSynthesizer](/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizer](/es/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
- [Contenedores de API de C# de Unity para el GDK](/es/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XSpeechSynthesizerCreateStreamFromText](/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)
- [XSpeechSynthesizerCreate](/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreate.md)
- [Texto a voz](/es/build/console-features/text-to-speech/text-to-speech.md)
