diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 22bfad1..c91a90e 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -330,6 +330,31 @@ function Disable-Registry-Keys { Start-Sleep 1 Remove-Item "$startMenu\VoiceAccess.lnk" -Force -ErrorAction SilentlyContinue } + + + $root = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture' + $allFX = (Get-ChildItem $root -Recurse).Name | Where-Object { $_ -like '*FxProperties' } + #search the fx props for VocalEffectPack and add {1da5d803-d492-4edd-8c23-e0c0ffee7f0e},5 = 1 + foreach ($fxPath in $allFX) { + $keys = Get-ItemProperty "registry::$fxPath" + foreach ($key in $keys) { + if ($key | Get-Member -MemberType NoteProperty | Where-Object { $_.Name -like '{*},*' } | Where-Object { $_.Definition -like '*#VocaEffectPack*' }) { + Write-Status -msg "$(@('Disabling','Enabling')[$revert]) AI Voice Effects..." + $regPath = Convert-Path $key.PSPath + if ($revert) { + #enable + $command = "Reg.exe delete '$regPath' /v '{1da5d803-d492-4edd-8c23-e0c0ffee7f0e},5' /f" + Run-Trusted -command $command -psversion $psversion + } + else { + #disable + $command = "Reg.exe add '$regPath' /v '{1da5d803-d492-4edd-8c23-e0c0ffee7f0e},5' /t REG_DWORD /d '1' /f" + Run-Trusted -command $command -psversion $psversion + } + + } + } + } #force policy changes Write-Status -msg 'Applying Registry Changes...'