Both the answers above are good ones, but make sure of two things that your dock connector assembly cable is in good shape, and that the connection to the logic board is sound. Having the speaker working and fine does you no good if your connection to it and the power source (the battery via the logic board connector) is bad. You may need to replace the dock connector assembly cable and when you do this you will have a chance to check out if the speaker is aligned correctly and is making contact with the connector. Get a good magnifying glass or a microscope to check the pins on the logic board connector and the pins on your dock connector cable. If they are bent, broken or crossed that might explain your loss of power issue. Sometimes small bits of metal dust can get lodged into the pins and case all kinds of issues. To solve some of these issues though you need to replace the whole dock connector assembly just to get things working again.