Chosen Solution

My microphone works fine when I use the phone also works when I double tap the home button to use “ok google” followed by what ever I ask of it to search for, but it doesn’t work when I have a call on speaker. Connected headpiece works fine, bluetooth devices work fine as well.

Same issue for me. I just replaced the screen on my phone

microphone doesn’t work when call is on speaker

I had a phone, it has the same issue on whatsapp video video calls, on-speaker calls, its not an issue with hardware or software of the phone, Actually it has another microphone on the top of phone, and it got covered by the plastic cover, just remove that part of cover.