Is your iPhone on the latest firmware of iOS 14? If not, you can find instructions to update your device here:
Update your iPhone, iPad or iPod touch - Apple Official Support
If an update is no help to the issue, you may need to perform a backup of the device and then DFU restore it. Follow the instructions below.
How to back up your iPhone, iPad and iPod touch - Apple Official Support
DFU Restore - iFixit Support
And if a DFU restore is still no good, then there is possibly a hardware issue or problem with the speakers that could need a repair from an Apple Store or Apple Service Provider. You should get your iPhone checked. But before you step out the door, make sure you have backed up your device.
Hope this helps.