Hello psychosquirrel13,
Thanks for using Apple Support Communities! I see you're having an issue with the speakerphone on calls, and I'd like to help out.
Does the speaker icon on the call screen turn off when this happens?
Which iOS version do you have installed on your iPhone X?
Is the other party able to hear you without any issues, when on the speakerphone?
Have you restarted your iPhone since noticing this issue? If not, go ahead and do that, as a restart can resolve unusual issues.
Restart your iPhone
Take a look at this article for help with sound issues: If you hear no sound or distorted sound from your iPhone, iPad, or iPod touch speaker
Thanks!