Owners of Google's Pixel and Pixel XL have been reporting a pretty deal-breaking audio issue lately; the phone can't play anything at high volumes without distorting it, no matter what the source of audio content, and no matter what the playback device is, be it a Bluetooth speaker or a Cast device. Owners flocked to Google's product forums for the two phones, only to be told, essentially, that Google was just as confused as they were and would have to look into the issue further. The custom ROM community was mostly unable to offer any help, until one particular ROM, focused on audio, was found to be without the issue. That rom is WETA, and the audio module from it has been extracted for any Pixel and Pixel XL user to take advantage of no matter what their ROM, or even if they're on the stock firmware from Google.
The fix comes in the form of a flashable ZIP file, which you will have to use TWRP to flash. If you are on bone stock and have not modified your phone at all, you will need to go through the requisite procedures to unlock your bootloader, flash a custom recovery, and ensure everything works fine. Once you've done all that, or if you already have TWRP or a custom ROM, you can proceed to flash the mod.
Flashing the mod is the easiest part of the process. No matter what ROM you may be on, simply boot into TWRP, flash the mod, found at the source link, and reboot. Your audio should be fixed up nicely. The reason the mod works, some in the community speculate, is because it uses a special community-made audio kernel mod called VIPER4Android, which has been around for some time now. Users of WETA Rom who picked the option to use VIPER4Android instead of the stock audio kernel got a pleasant surprise, and thus the cure was discovered and work began on bringing it to the masses. Credit goes to a Redditor by the handle of Ramacher for discovering that you can flash the mod on any ROM and don't have to commit to WETA in order to fix your audio.