If you support users who rely on headsets for Teams, Zoom or browser-based call systems, you will know how common these problems are:
-
Microphone randomly stops working
-
Chrome cannot detect the headset
-
Audio switches back to laptop speakers
-
Calls drop or have no sound after Windows updates
This script fully resets the Windows audio stack and clears Chrome’s broken media state in one run.
It is designed for engineers who are tired of fixing the same headset issue again and again.
What this script fixes
This script:
-
Disables built-in laptop sound hardware so Windows cannot auto-switch back
-
Forces the USB headset as the default microphone and speaker
-
Fully resets Chrome WebRTC, GPU and media cache
-
Improves Chrome audio buffering for more stable calls
-
Restarts Windows audio services
When should you use this?
Use it when:
-
Users complain their headset works in one app but not another
-
Chrome calls fail after Windows updates
-
The microphone works in Windows settings but not in the browser
-
Audio devices keep swapping back to Realtek instead of the USB headset
The PowerShell reset script
Run this as Administrator only.
<#
.SYNOPSIS
Fully resets Windows audio, disables onboard sound hardware, forces headset as default,
completely resets Google Chrome audio/WebRTC state, and applies Chrome buffer tuning.
#>
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Host "This script must be run as Administrator."
Exit 1
}
$OnboardAudio = Get-PnpDevice -Class MEDIA | Where-Object {
$_.FriendlyName -match "Realtek|Conexant|Intel|AMD|High Definition|Smart Sound"
}
foreach ($Device in $OnboardAudio)
{
if ($Device.Status -eq "OK")
{
Disable-PnpDevice -InstanceId $Device.InstanceId -Confirm:$false
}
}
$Headset = Get-PnpDevice -Class AudioEndpoint | Where-Object {
$<em data-start="2248" data-end="2277">.Status -eq "OK" -and
$</em>.FriendlyName -match "USB|Headset|Jabra|Poly|Plantronics|Logitech|EPOS"
} | Select-Object -First 1
If (-Not $Headset) { Exit 1 }
$SoundPath = "HKCU:\Software\Microsoft\Multimedia\Sound Mapper"
New-Item -Path $SoundPath -Force | Out-Null
Set-ItemProperty -Path $SoundPath -Name "Playback" -Value $Headset.FriendlyName -Force
Set-ItemProperty -Path $SoundPath -Name "Record" -Value $Headset.FriendlyName -Force
Get-Process chrome -ErrorAction SilentlyContinue | Stop-Process -Force
Start-Sleep -Seconds 5
$ChromePaths = @(
"$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Cache",
"$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Code Cache",
"$env:LOCALAPPDATA\Google\Chrome\User Data\Default\GPUCache",
"$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Service Worker\CacheStorage",
"$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Media Cache",
"$env:LOCALAPPDATA\Google\Chrome\User Data\GrShaderCache"
)
foreach ($Path in $ChromePaths)
{
if (Test-Path $Path)
{
Remove-Item -Path $Path -Recurse -Force -ErrorAction SilentlyContinue
}
}
Restart-Service Audiosrv -Force
Restart-Service AudioEndpointBuilder -Force
Why this works
Windows does not clean up broken audio states properly. Chrome also stores WebRTC and GPU cache that becomes corrupt over time.
This script forces both Windows and Chrome back to a known clean state so calls work properly again.