I had the same problem with my G4, but thought that it was a problem with the speaker itself (meaning that it was a hardware prob. not a software problem.) Anyway, I went inside my G4, took out the speaker, popped the actual speaker out of its plastic case, straitened the wires going to the speaker, and then put it back together. I played an Mp3, DVD, all alert sounds, basically everything, and they all worked. If the problem occurs again, repeat the process. DO NOT HAVE SPEAKER PLAYING WHEN MAKING REPAIRS!!!
Ok, hope it works like a charm like it did for me.