Did you mean top speaker (earpiece speaker, used to hear sound during calls) or bottom speaker (loudspeaker, used to play music, ringtones and etc.)
If it's the bottom speaker, there is a chance you may have ripped the charger port dock assembly cable slightly where it has a connection to the bottom speaker. You can check this by physically looking at the cable. If it is ripped, you will need to replace the charging port dock cable assembly.
For the top speaker, it is most likely not aligned well enough for the top speaker to have contact with the gold contact points on the front camera flex cable assembly which sits behind the front display. Also make sure that the metal cover prongs are correctly seated on the plastic frame behind the iPhone display. There is one at the left and one on the right of the metal cover. The left side slides in a hole and the right side slides in a hole as well which will sometimes needs to be pushed in the hole to the left to lock it in place.