Chosen Solution
My iPhone didn’t record sound without the headphones and the speaker volume went down a lot
When you open voice memos does it say “no recording devices found” or is the speaker button grayed out on phone calls? If so, that is most likely an audio IC issue which is quite common on the iPhone 7. You’ll need a skilled tech to perform this repair as they will need to de-solder the audio IC chip, solder a very thin wire from one point to another on the board, and re-solder the chip back on.
The iPhone has such a combination of hardware with software. If the hardware failure that can easily show system like speaker greyed out, un tappable recording option,Siri unable to receive command like that so make sure this function is ok. If not then that is the fault of audio ic.