The same thing happened to me. I also have an HTC One M7 and I took my phone into a repair shop for a broken screen, and got it back with a cracking/static noise coming from the speakers when the volume was turned up past the 3rd notch. I tried restarting it, turning the Beats audio on and off and nothing helped. I took it back up to the shop where I had the work done and the tech was unaware of the problem but immediately took another look at the issue. He said sometimes the speaker gets slightly damaged, or simply misaligned (not factory flush), when taking the phone apart over and over. He replaced it with the speaker from another phone (HTC One X) and that fixed the problem. It took less than an hour.