Why does the sound on my iphone not work for music?

I have an iphone 4s which is in pretty good condition considering i have had it for over a year but about 2 months ago the sound stopped working for music and games without earphones? My sound is completely fine when i have earphones plugged in but without them i can't listen to music or hear any sound when on apps/games, the sound works for calls and on facetime however it does mess up sometimes and go off, i have tried all I can think of to fix it but nothing works, i was going to get it sent off for repair to see if they could find the solution but i thought i may find an easier way as i don't want to be without my phone for a long period of time can anyone help please?

A similar thing happened with my iPod touch, the skin went "tinny" rather than completely gone. I had a software update, and everything wa fine. You could try that? Hope it works…

Take it to an apple store. They might just replace it for you. Either there or your service provider if it's still under warranty. Call Apple and ask what their conditions are for replacing it. Don't get the 5 if you have the option to upgrade though, it's a disappointment.

Try pushing down on the speaker but with your palm and pat it a few times, have music playing and see if you can feel any vibrations from the speakers if you can keep patting until you get sound

Worked for mine my speakers were broken but were still vibrating so I kinda circuited them again by pushing on them with my finger it might not work but you have nothing to lose otherwise you could try a full system reset