-
-
Save Natsumi-sama/5b73622158b32ad56460865d38c7e19e to your computer and use it in GitHub Desktop.
Add all SAPI voices to OneCore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sourcePath = 'HKLM:\SOFTWARE\Microsoft\Speech\Voices\Tokens' | |
$sourcePath32 = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens' | |
$destinationPath = 'HKLM:\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens' | |
#cleanup | |
$listOldVoices = Get-ChildItem $destinationPath | |
foreach($voice in $listOldVoices) | |
{ | |
if ($voice.PSChildName.StartsWith("TTS_") -or $voice.PSChildName.StartsWith("IVONA 2")) { | |
$path = $voice.PSPath | |
Remove-Item -Path $path -Recurse | |
} | |
} | |
$listVoices = Get-ChildItem $sourcePath | |
foreach($voice in $listVoices) | |
{ | |
$source = $voice.PSPath | |
copy -Path $source -Destination $destinationPath -Recurse | |
} | |
$listVoices = Get-ChildItem $sourcePath32 | |
foreach($voice in $listVoices) | |
{ | |
$source = $voice.PSPath | |
copy -Path $source -Destination $destinationPath -Recurse | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment