Force sound's output on speakers [duplicate]
Solution 1:
This is a hardware problem, unfortunately. The problem here is that inside the port there is a "switch" that detects whether a jack is plugged in or not and depending if one is, plays audio through the jack or the internal speakers.
The linked article talks about a malfunctining switch/port, but this isn't your case as you described; you have a stuck 3.5mm jack that won't come out so the switch is set to play audio through the port and unfortunately, there's no overriding it.
The only other options are to:
get a USB DAC (Digital Audio Converter) which is basically a USB soundcard to hook your audio/speakers up to
take the Mac in for service to have a new audio port soldered on.
Solution 2:
Someone has had a very similar case Headphone jack broke and got stuck in headphone socket MacBook Pro
It was also solved through hardware though may be possible through software if someone knows how.