Skip to content

How to add more voices

Dmitry Shin edited this page Oct 18, 2020 · 7 revisions

If you need to add more TTS notification voices, you can install. To add a new speech language, use this guide: https://support.microsoft.com/en-us/office/4c83a8d8-7486-42f7-8e46-2b0fdf753130

However, even after installing a new language (voice), it may not appear in the list of available voices for the guide. To solve this problem, you need to run a powershell script that will transfer the necessary voices from the registry.

Transfer voices script

$sourcePath = 'HKLM:\software\Microsoft\Speech_OneCore\Voices\Tokens' #Where the OneCore voices live
$destinationPath = 'HKLM:\SOFTWARE\Microsoft\Speech\Voices\Tokens' #For 64-bit apps
$destinationPath2 = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens' #For 32-bit apps
cd $destinationPath
$listVoices = Get-ChildItem $sourcePath
foreach($voice in $listVoices)
{
$source = $voice.PSPath #Get the path of this voices key
copy -Path $source -Destination $destinationPath -Recurse
copy -Path $source -Destination $destinationPath2 -Recurse
}

To run this script, go to Windows search, type PowerShell. Run the found application as Administrator (right click - "Run as Administrator"). Paste the above script into the console that opens and press Return. The voices must transfer.

To check the result, you can use another script below.

Script for displaying a list of available voices

Add-Type -AssemblyName System.speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$speak.GetInstalledVoices() | Select-Object -ExpandProperty VoiceInfo | Select-Object -Property Culture,Name,Gender