add disable ai voice effects

This commit is contained in:
zoicware
2025-10-27 20:51:02 -04:00
committed by GitHub
parent c9c3618868
commit f7867598b4

View File

@@ -331,6 +331,31 @@ function Disable-Registry-Keys {
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...'
gpupdate /force >$null