Chosen Solution

I woke up 2 days ago and my phone was working fine. I plugged up my headphone and it was playing music as normal . Out of no where the music stopped and when i went to press play again it played through the speaker and not the headphones. i proceeded to place a call & the phone automatically goes on speaker and does not let me deselect the speaker button(stays black) i tried completely reset the phone as new after a back up and it still doesnt work. please help!!

The first thing I would try is to do a hard reset. Also, if you have the opportunity, I would also do a backup of your data via iTunes or iCloud. The iPhone 7 series of devices suffers from issues with the Audio IC and weak traces on the pcb which crack and break. It is a similar design flaw to the iPhone 6 Plus, known as Touch Disease. On the iPhone 7 series, the weak traces are underneath the Audio IC. This could be the problem with your phone. This would require a micro-soldering repair and is not DIY. However before going that route, the Lightning Port, which controls the audio accessories could also be the culprit so you could consider changing that first.