I am working on an audio project in which a voltage controlled square wave oscillator drives a 5W 4Ohm Speaker. I am using a unipolar 12V supply. In order to limit the current going through the speaker I use a TIP31A (NPN power transistor) with a 10k resistor at it's base, which acts to limit the current across the speaker to ~0.4A (12V x 0.4A = 4.8W of power). However, I'm running into a problem where the transistor is getting very hot.
What I'm wondering is this: does the transistor get hot based on the fact that it is limiting current, or does it get hot simply based on the amount of current passing through it? If I reduce the size of the current limiting resistor at the transistor base and added another current limiting method, such as a power resistor in series with the speaker, would that reduce the amount of heat dissipated by the transistor?
Here is the part of the schematic relevant to power consumption, square wave flips 2n3904 on and off (this is to invert the signal, since the oscillator idles high) which controls power on the base of the TIP31A, which in turn drives the speaker:
Here is the full schematic. Keep in mind I am driving the speaker with a square wave (full on / off) so changing the amplifier topology to class B or AB will not help.