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

# XSpeechSynthesizerSetCustomVoice

> XSpeechSynthesizerSetCustomVoice

# XSpeechSynthesizerSetCustomVoice

Especifica que el sintetizador de voz debe usar la voz personalizada especificada.

## Sintaxis

```cpp theme={null}
HRESULT XSpeechSynthesizerSetCustomVoice(  
         XSpeechSynthesizerHandle speechSynthesizer,  
         const char* voiceId  
)  
```

### Parámetros

*speechSynthesizer*   \_In\_\
Tipo: XSpeechSynthesizerHandle

Especifica el sintetizador de voz que usará la voz personalizada.

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

Un identificador de voz en una estructura [XSpeechSynthesizerVoiceInformation](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md), devuelto en la función [XSpeechSynthesizerInstalledVoicesCallback](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback.md).

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

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

* Para cada voz instalada, la estructura [XSpeechSynthesizerVoiceInformation](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md) proporciona el identificador de la voz, la descripción, el texto para mostrar, el género, el idioma y otra información.

* Para enumerar y obtener información sobre las voces instaladas en el dispositivo actual, use la función [XSpeechSynthesizerEnumerateInstalledVoices](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices.md) junto con la función de devolución de llamada [XSpeechSynthesizerInstalledVoicesCallback](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback.md).

* Para usar la voz actual del sistema para el sintetizador de voz especificado, llame a [XSpeechSynthesizerSetDefaultVoice](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetdefaultvoice.md).

* Para ver un ejemplo que muestra cómo usar la función **XSpeechSynthesizerSetCustomVoice**, 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)\
[XSpeechSynthesizerCreateStreamFromText](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext.md)\
[XSpeechSynthesizer](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)


## Related topics

- [XSpeechSynthesizerEnumerateInstalledVoices](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices.md)
- [XSpeechSynthesizerInstalledVoicesCallback](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback.md)
- [XSpeechSynthesizerVoiceInformation](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md)
- [XSpeechSynthesizerSetDefaultVoice](https://docs.xbox.com/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetdefaultvoice.md)
- [Texto a voz](https://docs.xbox.com/es/build/console-features/text-to-speech/text-to-speech.md)
