You could use the output of your envelope generator to drive the base of a transistor which amplifies the square wave signal.
To be fair, instead of your envelope circuit that decreases the output, I'd simply charge a capacitor through a resistor; that leads to a \$1-e^{-t}\$ kind of voltage over the capacitor. That, in turn, I would connect to the base of an NPN transistor (possibly with a bigger base resistor not to distort the voltage curve too much) in common-emitter configuration. That would attenuate the input signal with rising voltage.
simulate this circuit – Schematic created using CircuitLab
Notice that I used C2 to capacitively couple your square wave into the circuit, and C3 to couple it out – that forms a high pass filter (i.e. DC can't go through), and the frequencies at which that circuit cuts off depend on the values of C2 and R5, and also on C3 – you can safely make C3 a lot bigger than 100nF. Don't worry about this changing your signal – it does – because your speaker doesn't care (or like) DC, anyway.
So what happens here is that you first have R3/R4 forming a voltage divider – so if there was nothing else, the collector point of Q1 would be at exactly 4.5V.
Then you couple in your signal through C2 and R5 – this "pulls" that 4.5V up and down with the high-passed input signal.
The variable attenuation happens because parallel to R3, we have Q1's collector-emitter resistance. When the current flowing into Q1's base (from the "capacitor's voltage" node through R2) is high, that resistance becomes low – in fact, significantly lower than R3 or R4. So what our signal now sees, after "coming out" of C2 is a voltage divider formed by R5 and Q1's collector-emitter resistance. The lower that gets, the smaller the ratio of output- to input voltage of that divider!
Because, as said, we don't want DC to flow through the speaker, we then pass the result through C3.
Congratulations! The simplest possible voltage controlled amplifier :) Note that this isn't even remotely linear in amplification. But square waves don't really call for "correct" or "clean" amplification, do they?