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

# 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](/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation), devuelto en la función [XSpeechSynthesizerInstalledVoicesCallback](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback).

### 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](/reference/errorcodes).

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

* Para cada voz instalada, la estructura [XSpeechSynthesizerVoiceInformation](/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation) 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](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices) junto con la función de devolución de llamada [XSpeechSynthesizerInstalledVoicesCallback](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback).

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

* Para ver un ejemplo que muestra cómo usar la función **XSpeechSynthesizerSetCustomVoice**, 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

## Documentación conceptual

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

## Consulte también

[XAccessibility](/reference/system/xaccessibility/xaccessibility_members)\
[XSpeechSynthesizerCreateStreamFromText](/reference/system/xspeechsynthesizer/functions/xspeechsynthesizercreatestreamfromtext)\
[XSpeechSynthesizer](/reference/system/xspeechsynthesizer/xspeechsynthesizer_members)


## Related topics

- [XSpeechSynthesizerEnumerateInstalledVoices](/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerenumerateinstalledvoices.md)
- [XSpeechSynthesizerInstalledVoicesCallback](/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizerinstalledvoicescallback.md)
- [XSpeechSynthesizerVoiceInformation](/es/reference/system/xspeechsynthesizer/structs/xspeechsynthesizervoiceinformation.md)
- [XSpeechSynthesizerSetDefaultVoice](/es/reference/system/xspeechsynthesizer/functions/xspeechsynthesizersetdefaultvoice.md)
- [XSpeechSynthesizer](/es/reference/system/xspeechsynthesizer/xspeechsynthesizer_members.md)
