IPhone 7 ringtone and alarm problem?

Recently my iPhone 7 stopped making sound when recieving calls and when the alarm goes off.
When trying to switch a ringtone, they all make the same default sound, and all do not make sound when recieving calls. Same thing with alarms, they all make the same default sound and make no sound when the alarm goes off.
The ringer is on and in full volume, I've restarted the phone, hard reseted it, I've reset the settings to default settings and still nothing solves the problem.
Can anyone please help?

Usually the resetting network settings help but it may be stuck in headphone mode. In which you could plug them in and out a few times then try an alarm to see if working.

It isn't stuck with headphone mode, it makes music sounds and everything else but the ringtone and alarm noises…

Check to ensure that the mute slider wasn't just turned on (it's on the side of your device). If your headset port is damaged from snagging a wired headset a few times, or unplugging it at an angle, you can verify it by plugging in the same wired headset.

If all sounds and call volume work like they should, plug it in and unplug it a few times. Otherwise you will have to bring your iphone to a repair shop so the headset port can be replaced. It's simple really.