Reefer Sutherland wrote:Cut the volume if it gets too loud. Maybe set the threshold for it with a parameter in the settings?
I mean, I never exceed 0dB. If the master volume in Buzz would get louder than that,
I'd rather it just silenced the output instead of clipping.
I'm also not a coder

unfortunately suggestions like these are useless because for example sudden whitenoise that peaks at 0db (-1.0 / 1.0) isn't exactly a pleasure to listen to either....(assuming you compare it with your normal "song" at "sane" loudness).
if anything you'd certainly not activate it at 0, but rather something like +12 or even +20 or whatever.... you dont want the occasional peak to activate it either.
it goes more into the direction ix / mtronic suggested, you have to look for sudden increases in rms imho, but still let transients trough...
and rather than absolutes, you look more for relative changes...
if you look at the metering in mixio (it's rms calculation applies a factor of sqrt(2) for peak-to-rms equivalence) you'll also see that for simple sinewave for example the rms and the peak is the same. looking at peak-to-rms is also not the solution really..
its not trivial to come up with a good burst protection, i wonder what old overloader did tough. it might get a little easier if you assume that the data is truly garbage and more or less random (not audio at all...and not within the output range at all), but that only covers some of the problems.
the question is less of "what is a noise burst" but "what do we consider a noiseburst and what exactly do we want to prevent". If we define it to something we agree helps protect ears and speakers, its certainly implementable... i googled around a little but couldnt even find a simple definition...