Is there a plug-ins which gives, in a way, the algebraic sum of all samples of a ‘wav’ track?
The sum, in case of a normal audio track, is zero or close to it.
But if the values of the ‘wav’ samples were corrupted, this sum would likely be far from zero. In case the sum is a big number and exceeds a certain high limit, the plug-ins needs returning the value of the limit only.
That could have been avoided by error checking. for example:
((= len 0)
"Error.\nStereo tracks are not supported.")
(let ((t1 (/ (1- len) *sound-srate*))
(integral (mult (/ *sound-srate* len)
(print (abs-env (sref integral t1))))))
Another way you could do that would be to duplicate the track, then use the Normalize effect to “Remove DC offset” (only), then invert the duplicate track and mix the two tracks (Tracks menu > Mix > Mix and Render). The result will be the DC offset. This could also be automated with a Macro (Macros - Audacity Manual), or a Nyquist-Macro (Nyquist-Macros - Audacity Manual).
Thank you, Steve, for the extra work. I saved it and I will install it as a new plug-in.
Although this sum/average function may help, as I mentioned earlier, in detecting corrupted samples in rare cases, it is useful in the case (about which we will talk later if you like) when a different signature is inserted in every copy of an audio file but without affecting in any way the audio quality and its originality**… also its DC zero average**.