Hi, thank you for contacting JustAnswer.com. My name is Russell. I will do my best to provide the right answer to your question.
"But not the speaker," you mean, I presume.
Several things can cause that. The first is, you may have a jammed internal switch in the headphone jack. That can disable the speakers, if the switch that cuts off the speaker output gets stiff and doesn't 'snap back' when the jack is removed.
Or, the audio amplifier's signal route to the speaker output(s) can be cut off by other means.
Breakage internally, blowing a speaker fuse (if there is one in your device... overload fuses can be included in some designs, or in more recent designs of audio devices, speaker output short circuits can cause shutdown of the audio outputs for safety, sometimes known as safe mode.)
If the on/Off light is not staying On, what is the pattern, does it flicker or go out after the device is turned On, and without any change in the speaker sound?
Tell me more about the problem's symptoms and I will advise you further.