Some digital amplifiers for sound use simple non linear power supplies that lower voltage on higher loads. What is it doing to the input signal from the source compared to the signal sent to the loudspeakers and how is the input level from the power supply used in the computation?
Assuming you know how class-D amplifiers with feedback work:
You really only need to compute the average power of the input, i.e. something like (lowpass(input²)), and reduce the supply voltage accordingly.
When output power is low, then the amplifier would, at a high supply voltage, turn on the current through the output inductor for very short periods of time, which would suffice to store the necessary energy to drive the speaker in the inductor's magnetic field.
However, since your amplifier has feedback, it's not using a constant "input voltage->duty cycle mapping", it simply keeps the output current flowing for as long as necessary to store the required energy in the inductor. Hence, reducing the input voltage when you don't need much energy in the inductor simply leads to longer on-times.
This only makes sense if your power supply has an especially efficient lower-voltage mode.
You maybe referring to class H or class G amplifiers. This have power supplies with switchable or continuous power rails. The signal processing is does tracks the input and and switches/adjusts the rails so they stay high enough but not higher than they need to be, which minimizes power supply losses and can also greatly reduce idle power.
This needs to be a little "predictive" since the rail switching is typically slower than the signal itself.