Shine a light into the headphone jack and look to see if there's any debris of any kind in there. Something pressing against the speaker cut off switch would cause the symptoms your wife's iPhone is experiencing. If you see any debris you could try sucking it out with a small nozzle on a vacuum cleaner. If that doesn't work you could, very carefully, see if you could dislodge it with something like a toothpick. If you're uncomfortable with that, any local repair shop should be able to help you.
Of course, if there's no obvious debris in the headphone jack, the headphone jack may be defective. In that case, a diagnostic check at a repair centre would confirm it.