If you lose sound for keyboard clicks, games or other apps, email and other notifications, system sounds have probably been muted.
System sounds can be muted and controlled in two different ways: either by the side switch (located next to the volume up/down controls) or in the Recent Apps tray. The initial default is via the side switch.
Check the status of Settings > General > Use Side Switch to:. If this is set to Mute, the switch on the side of the iPad will mute system sounds.
If this is set to Lock rotation then the mute system sounds control is in the Recent Apps tray. Double tap the home button and, in the tray which appears at the bottom, swipe all the way to the right. The speaker icon is on the left. Is it is crossed-out tap on it and mute will be turned off and system sounds will be turned ON.
This Apple Support article explains in more detail how the side switch works.
I believe, I know the solution to your problem.
I faced similar issue with my new iPhone 5.
Small dirt had been inserted on my iPhone earpad jack.
When I inserted my earpads sound was OK.
It seemed that iPhone circuitry recognized the dirt as if the earpods were inserted
and didn't send any sound on speakers.
So, I inserted a tiny pin on the earpad jack and took off the small dirt.
Then, sound came out of the speaker and everything is OK till now. Try it.