click here: If you hear no sound or distorted sound from your iPhone, iPad, or iPod touch speaker
If that doesn't work yes it could be hardware and you should arrange a repair
https://support.apple.com/iphone/repair/service
Anything other than Screen or Battery may be a replacement phone and the price is in the article, depending on your warranty or AppleCare+ status.
You can see additional service information within the following article:
Get your iPhone, iPad, or iPod touch ready for service - Apple Support
iphone X have not been available from Apple for some time so I am not sure ifyou really mean "New" iphone X