Let's just do a quick check, head to your dial pad and dial *#0*# and select 'Speaker' when you have your headphones plugged in.
Does the sound play through your headphones?
If not I'd recommend popping into your nearest Service Centre to have your phone looked at.
That would highlight that it is not a hardware problem with your phone.
Come out of the hardware test and try starting your phone in Safe Mode:
To do this, turn off your phone then hold down the Power button to turn on your phone as usual, then once the Samsung logo appears press and hold the volume Down button until the home screen appears. Safe Mode will now display in the Left hand corner.
Test out the sound when in Safe mode and let me know how it goes.
I am having the same problem. I did the dialpad thing and checked speaker and did get sound through my headphone. So then moved on to safe mode. In safe mode I could here the dialtone and the message when I called someone, but not any other sounds on my phone.
I have the same problem but all the work around didn't work. Still, the sounds played through the speaker even there's a headphone inserted (properly fit in the headphone jack port).
It just happened suddenly. The phone didn't fall or what, I didn't submerge it to a water or wet it. I thought at first it just needs a powerboot/restart but no difference. I even check if there's a new software update maybe it will fix the issue but unfortunately there's none.
Now I cannot use a normal headphone on my S7 Edge, can someone please help me out?