My iPhone 4S fails and works exactly the same every time:
FAILS, with the phone on speaker, or with the camera recording video (front or back) no sound is captured.
WORKS, in all other situations and apps that I could think of that use the microphone such as
google, Voice Memo, Dragon Dictation, Vonage Extensions, Skype, and taking the phone OFF speaker holding the phone to my ear. And also select microphone key to voice input instead of typing whenever the keyboard is there (Mail, Notes, Reminders, Safari, Maps, google Maps, ...)
Based on that, my guess is it's not hardware.
I'm using a 4S (64GB) from Verizon. In the nearby Verizon store I was told to back it up, do a master reset (which wipes out the phone), and restore it from the backup. I called Verizon support today before doing this and got exactly the same instructions. That's what I did today and NOTHING GOT BETTER.
After reading several discussion boards I made sure that I was not blocking any of the holes (trying to be thorough). I do not use a cover.