Why did my iphone sound stop working?

Randomly today the sound stopped working.iI went into settings and checked everything. When I watch a YouTube video or play a song there's still the play and arrow button but no volume bar for anything? I didn't drop my phone or anything. Can someone please help me I need it for an alarm

Anything to corrupt the speaker would either be water, severe drop, electrical short, or software glitch. Obviously water and drop are ruled out. Turn it off then on. If still not working do hard reset(not restore)[Press and hold home and sleep/wake button until the device powers off and don't touch the screen if it says slide to turn off] if still not working you will have to restore it, so back up your data to icloud or your computer then restore it. After youve restored it try it again if not working, apple will replace it faster than you could imagine… They'll ask questions then replace it… Nothing to it.