Skip to main content

XSpeechSynthesizerEnumerateInstalledVoices

Enumerates the installed voices, and calls the method pointed to by callback for each voice.

Syntax

Parameters

context   _In_opt_
Type: void*
A user-specified variable that will be passed into the callback function to enable the caller to recover caller-specific data. callback   _In_
Type: XSpeechSynthesizerInstalledVoicesCallback*
A pointer to the method that will be called once per installed voice.

Return value

Type: HRESULT Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
This function enumerates over the speech synthesis engines, or voices, installed on the device. The function invokes the XSpeechSynthesizerInstalledVoicesCallback callback function specified in callback once for each installed voice, and it passes an XSpeechSynthesizerVoiceInformation structure that contains information about that voice. The following example demonstrates how to call the XSpeechSynthesizerEnumerateInstalledVoices function to enumerate over the installed voices on the device. The example invokes the XSpeechSynthesizerInstalledVoicesCallback callback function to (1) count the number of voices installed on the device and to (2) output information about each installed voice from the XSpeechSynthesizerVoiceInformation structure to the debugger.

Requirements

Header: XSpeechSynthesizer.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XAccessibility
XSpeechSynthesizerSetCustomVoice
XSpeechSynthesizer
Last modified on August 20, 2026