As of plain clipping avoiding rail smashing, single diode drop is often not enough, so I often use a couple antiparallel red Leds, 1.9V peak each way so nice 1.5V RMS , enough for any regular power amp, and then add a trimmer after that, as a fixed Master Volume.
I start with "Master" set to "1" , rise signal until Leds moderately clip (flat topped sinewave) , then slowly rise master trimmer until I see Class D amp clip on its own, which is clearly visible, sinewave becomes "squarier" and tops become flatter and wider, then back up a little until Class D amp is not clipping on its own.
Then leave it there.
In a way, same as old VOX Thomas limiter, only they varied clipping threshold by adjusting diode bias, I do the opposite by relying on fixed clipping, no bias involved, and varying clipped signal out level.
End result ia about the same.
You can use strings of plain diodes instead, but 2 Leds are equivalent to 6 diodes, for about same result,so I pick the simplest version.
Itīs also easier to add to a pre existing circuit, no PCB needed