Circuit with constant output amplitude
This is a common enough problem that such a circuit has a name, called automatic gain control, or "AGC".

Keep in mind that when you say "constant" amplitude, it has to be over some time.  If the signal were instantaneously constant, then it would be a DC source.  Usually AGC for audio has a time constant of a few 100 ms to over a second, depending on the purpose.

The obvious and simple way to do this is in a digital processor.  Enough samples can be kept in memory so that the volume can be smoothly adjusted so that the maximum peak in memory is just at full output.  Then performing the gain function is also easy since it is just a digital multiply.

Multiplying in analog by a value on the fly is difficult.  Fortunately for AGC you only need a two-quadrant multiplier, and it doesn't need to be very linear since it is inside the feedback loop.  (To clarify, signal in to signal out must be linear, but control value input to gain output can be non-linear).  Bill Hewlett's famous oscillator circuit used the non-linear characteristic of a light bulb to provide electronically alterable gain.  I did something similar many years ago with two LEDs taped to two light dependent resistors (LDRs).  The two LEDs were driven oppositely, and the LDRs were arranged in a voltage divider.  The voltage divider then essentially replaced a potentiometer used as a volume control.

There are other schemes for electrically controlled gain, but again, this is really asking for a digital imlementation today.