James,
Windows 11 has issues with audio due to a very heavy audio driver that's affected by other system software and other programs running at the same time. The problem with systems such as those by HP and Dell, for example, is that they come with extra things to monitor the hardware.
When I replaced my old desktop due to my USB ports failing, I got a high-end Dell 8950 computer. I set up everything and had crackles, zaps, pops, and outright scary buzzing. After replacing cables, and even going for a discrete soundcard, I still had problems and deep down inside I thought something was wrong with my Roland LX-17, perhaps a blown speaker or something even though I never pushed the hardware that loud.
Anyway, before I pushed the panic button completely and brought in a technician to look at the digital piano, I did some online searching and the audio issue was actually mentioned on Microsoft's tech forums! I sighed a breath of relief and then followed the threads others had posted.
Here's my experience with the problem and how I solved it. I also posted this elsewhere for someone else who actually has another issue, although the symptoms are similar.
.... Your computer has other things running in the background that will kick in and interrupt your audio drivers. Windows 11 doesn't help matters much because the audio hardware driver used by Windows 11 is "heavy" and uses a lot of resources. On my system, I found I had some system culprits there along with the crapware that Dell puts on their desktops.
When I first encountered this, I upgraded my audio hardware from the pale and poor example of audio hardware that Dell uses in their desktop computers to a higher end SoundBlaster AE-9 thinking that the built-in hardware couldn't keep up. The AE-9 also has better control over the audio output and I was able to turn off the stupid special effects such as "theater" and "concert hall" that did nothing but make the audio too saturated. But that only helped a tiny bit even after adjusting the buffer settings for AIO, and I felt quite upset I had spent way too much money on the SoundBlaster setup.
Not being one to give up easily, I kept checking around and after researching online, I found Latency Monitor to monitor who was interrupting.
https://www.resplendence.com/main
With Latency Monitor running, I played. Whenever I heard the shocking ZAP sound or buzzing and clicking, I'd stop the monitoring and look at the output log.
I had to do this numerous times and after a rather larger number of iterations, I finally killed a bunch of things that aren't necessary such as the XBOX Game Bar and Dell's Support Assistant software.
Dell's SA was the biggest culprit because when it kicks in, it grabs the system and starts interrupting the hardware as it checks the system. No matter what I did to adjust the schedule for the software worked and I ended up going into Computer Management and then Services and disabled the Dell SA and anything else that said DELL on it. You can also get there by right-clicking on the start menu icon and then choosing Computer Management. It's a lot quicker than digging for it in the Administrative Tools, or from a command prompt.
After going through this great exercise, I was able to run zap and buzz free. Honestly, I thought my speakers were blown on my expensive LX-17 when this first occurred and never thought it was the software being interrupted that caused that awful sound that would actually make me jump.