Two possibilities...
(1) you have accidentally activated the mute function. The Mute is controlled by either the hard switch next to the volume control or the soft switch at the far left of the multi-task bar (double press the Home button and flick the screen right).
(2) the volume is 'remembered' independently for headphones and speaker. So, if you were listening on a headphone at, say, full volume and then pulled out the headphone socket but previously the speaker had been on minimum volume then the sound would disappear completely.
Tim