This is a strange issue but it does happen occasionally. Your iPhone stops producing any sound. This can happen in a variety of situations.
Sometimes, this happens just after you plug the iPhone out of a dock or when you remove the earphone out of the jack. And of course, there are those times when it just happens.
In most cases, the issue is hardware-specific. iPhone's software turns off the speaker when it detects a dock connection or when it detects an earphone plugged in. Unfortunately, a loose wire connectivity can trigger this and even when you've undocked the iPhone or pulled out the earphone, the software might not kick in. That results in no sound.
So how to fix this “no sound” issue?
There are a few things you should try.
- Replug the iPhone to the dock and then remove it again. Sometimes, it's just a software pass-out and reconnecting the iPhone to the dock triggers the software again.
- If you use earphones, plug in and then remove it again. With the earphone removed, try increasing/decreasing th volume. Does the volume HUD say Ringtone (headset)? If yes, the iPhone is till thinking that the earphones are plugged in. If not, the speaker should be working now.
- Take a brush and dust off the dock connector. This region, which lies just close to the speakers, can accumulate a bit of a dust. With time, the dust becomes dense enough to actually trick the software into thinking that the iPhone is docked.
- You can also tap (a little strongly) right of the home screen. Right beneath this casing is the speaker connections. Something might have loosened up here. Tapping doesn't guarantee a working solution but it's known to fix things a few times.
- At a slightly advanced level you might want to take a sharp object – like a pin – and clear out the dust over the dock connector.
- Use the pin to clear out – very carefully – dust in the headphone port. Dust within the port can also cause sound problems.
If nothing works, you might try resetting the iPhone to default settings. If even that fails, restoring your iPhone from an older backup (or as new) might help.
Generally at this point, if the sound problems persist, it's time to take the iPhone to a service center.