Hi mate Sorry it might sound very silly but have you tried cleaning the lego connectors? It might be that some dust got there and it just doesn't get the spark. Does the cable look battered? If so then I'd advise you to change the earpiece to a new one.
Hi buddy. There are quite a few things that could happen. It could be loose wires or perhaps you've dropped the phone and the speaker got damaged. If it is brand new I'd advise you to get it checked by the experts on the guarantee. If second hand then it would be the best to replace the whole speaker if you're unfamiliar with repairs yourself.