Fix Windows Audio & Chrome Call Issues with One PowerShell Script

Fix Windows Audio & Chrome Call Issues with One PowerShell Script

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.

Total
0
Shares
Previous Post

Bulk Add Windows Autopilot Devices to Entra ID Groups Using Only Serial Numbers

Next Post

Fix Windows Log-On Issues by Repairing Critical Services and Forcing Group Policy

Related Posts

How to Set Proxy Settings via Group Policy?

The article shows how to use Active Directory Group Policies (GPOs) to configure proxy server settings on domain-joined computers running Windows 10/11 and Windows Server 2022/2019/2016/2012R2. These proxy server settings are used by all modern browsers, including Internet Explorer 11 (reached end of support on June 2022), Google Chrome, Microsoft Edge, Opera, and Mozilla Firefox
Read More

How to Convert ESD to WIM File on Windows

In this tutorial, we will show you how to convert ESD to WIM file from the Command prompt, using the DISM tool, or PowerShell scripts. ESD file is a new highly compressed image distribution format developed by Microsoft. The ESD (Electronic Software Download) image files are used to deploy the Windows operating system instead of
Read More