I had tested Carplay with others iPhones old IOS versions and than the sound don't show these glitches.
My is iPhone X IOS 11.3, the noise sound on CARPLAY is so bad, with Bluetooth Connection the quality is Better.
Many people with this problem are thinking the cause is Media Car or Cable, but they don't figured out about the real issue of this, IOS 11.3 accurately the sound has changed significantly to bad quality.
When you are playing music in Carplay, You can see the big difference when you change In <Settings> on <Apple music> in <Equalizer> to <Midnight> mode or from (Any mode) back to <Midnight> mode again.
You will listen the quality being better in a short time, but back the problem again in litter time after. In Midnight mode have some secret, I don't realize what is.
I don't know if Apple will fix this on the IOS 11.4 in June.
Today I had resetted iPhoneX to factory settings, no changes, same issue persist!
If anybody have any solution, please let us know.