Most smart phones have several microphones now for noise cancellation. The normal mic is down at the bottom. When you turn on the speaker it then switches to a different Mic away from the speaker to prevent feedback.
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?