1. If Side Switch is set to Mute, check to make sure it's not muted
2. Check the Volume buttons
3. Double-click the Home button; swipe the Task Bar to the right. Check the Mute and Volume settings.
I have the same problem, and it´s not the mute button, or the volume rocker. On facetime the sound works, and one of my apps also manage to get the sound working. On everything else there is no sound, but earphones work fine in all ocasions. This is a recurrent problem on the new iPad and I suspect a hardware fault.
there was an issue with iPhones a few years ago where the headphones socket was not detecting the headphones had been removed, so was routing sound via that socket, hence using headphones worked.
The trick was to plug in your headphones and then remove them, doing it slow, as removing them fast is what can cause the issue.
It may take a few attemps to get it working again.
This may help you in this case too.