probably a broken headphone port, you tried plugging some headphones in and then unplugging them see if that helps? also maybe its a software issue of some sort you could try a factory reset if youve restarted the phone already and that didnt help. my main advice though is plug in some headphones, then yank the plug back out, see if it fixes it, if not who knows. also if youve been messing with stuff like installing custom roms that might have something to do with it too