SpeechSynthesizer.TrySetDefaultVoiceAsync(VoiceInformation) SpeechSynthesizer.TrySetDefaultVoiceAsync(VoiceInformation) SpeechSynthesizer.TrySetDefaultVoiceAsync(VoiceInformation) SpeechSynthesizer.TrySetDefaultVoiceAsync(VoiceInformation) SpeechSynthesizer.TrySetDefaultVoiceAsync(VoiceInformation) Method

Definition

Asynchronously attempts to set the voice used for speech synthesis on an IoT device.

Note

This method is available only in Embedded mode.

public : static IAsyncOperation<Platform::Boolean> TrySetDefaultVoiceAsync(VoiceInformation voice)
static IAsyncOperation<bool> TrySetDefaultVoiceAsync(VoiceInformation voice) const;
public static IAsyncOperation<bool> TrySetDefaultVoiceAsync(VoiceInformation voice)
Public Shared Function TrySetDefaultVoiceAsync(voice As VoiceInformation) As IAsyncOperation(Of bool)
Windows.Media.SpeechSynthesis.SpeechSynthesizer.trySetDefaultVoiceAsync(voice).done( /* Your success and error handlers */ );

Parameters

voice
VoiceInformation VoiceInformation VoiceInformation

One of the installed speech synthesis engines (voices).

Returns

An asynchronous operation that returns true if the set operation was a success. Otherwise, returns false.

Additional features and requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

Your app must declare the systemManagement capability, which lets apps access basic system administration privileges including locale, timezone, shut down, and reboot.

The systemManagement capability must include the iot namespace when you declare it in your app's package manifest.

<Capabilities><iot:Capability Name="systemManagement"/></Capabilities>

Use Windows.Globalization.ApplicationLanguages.Languages to get the ranked list of current runtime language values preferred by the user.

See also