The problem started happening for me when I was trying to get my iHome P90 working again.
I downloaded the iHome Set app, and plugged my iPhone into the dock connector.
It seemed like the phone got stuck thinking it was plugged in, as other posters suggested.
(e.g. when I unplugged the phone and plugged it back in to the dock connector, I stopped receiving the "device not supported" error, but not in a good way)
And that is when my phone's sound stopped working. (music, games, system)
I was able to get sounds from Settings / Sounds / Ringtone
I was able to move my sound slider bar - it was not greyed out.
Other suggestions here that did not seem to work for me: wall charger / headphones, toggling bluetooth, cleaning dock connector, etc.
What did work for me: restarting the phone. i.e. powering it down (not putting it to sleep) and restarting it. The sound came back immediately after the restart.
I suspect the iHome Set app / speaker doc took over the sound interrupt / chip and failed to release it on undocking, as others have suggested. I did try killing the app, but that didn't work. It somehow left the phone/OS in a funky state. :-(
iPhone 4s
iOS 7.0.2
HTH,
n8
Now, back to figuring out why my iHome P90 doesn't like my 4s with iOS 7. :-(