I had the same issue with the iOS 6 upgrade and my iPhone 4S. My speaker wasn't emitting sounds.
Could my speaker have broken in the hour it took to upgrade from iOS 5 to iOS 6? Very very unlikely.
Some apps give you a choice as to where to send th sound. When running these apps it was clear that the phone did not think it had a speaker as that was not a choice given me.
Thus I realized that it wasn't the phone sending sound information to a speaker which didn't function, it was that the phone refused to send any sound to the speaker to play since it thought the speaker didn't exist.
Clearly this is a software bug. There are various configuration files on the phone and one of them got messed up
and it eliminated the speaker as a possible device. The problem happened when I upgraded from iOS 5 to iOS6.
Apple tests installing software on fresh phones so they haven't seen this problem in testing. However they can't test what happens when existing phones in various states are upgraded. Some of them did not upgrade correctly (like my phone).
I found the fix for my phone on these forums and reported it quite some time ago (it involved plugging the phone into the computer and running iTunes).
So now everything works correctly.
To address the recently discusion this thread. This is not a hardware issue, there is nothing wrong with your speaker. Nothing. It is outrageous for Apple to have ignored this problem so long and even more outrageous to ask you to pay even one cent to get a replacement phone just to get around their upgrade bug.