Skip to content

Instantly share code, notes, and snippets.

@Natsumi-sama
Natsumi-sama / add-voice.ps1
Last active February 10, 2024 12:42 — forked from hiepxanh/add-voice.ps
Add all SAPI voices to OneCore
$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