On review - you’re right. Provided that it is used on one continuous, non-silent audio clip, the current version shows the correct RMS level, even below -60 dB.
I was confusing the issue because of problems with white-space and discontinuous audio clips
What do you think it should show?
It needs to be (and is) handled specially so as to avoid divide by zero errors when converting from linear to dB, so we can handle this however we want.
We could make anything lower than -60 dB show as -60 dB. That would at least be consistent and would (correctly imo) produce “Fail” in the silly example of background silence and extremely quiet foreground.
We could show absolute silence as whatever the OS representation is (something like “#INFD” for Windows isn’t it?)
We could show absolute silence as a string of our choice (such as “silence” or “-inf”)
There are a lot of little bugs remaining in the Contrast tool - mostly P5 issues. I’ve been discussing this with Martyn and he has reviewed my patch that fixes most of them (off-list so as to reduce the noise during the run-up to the next release). He was happy for me to commit it, but I decided to wait post 2.1 (good idea me thinks )
We have a provisional plan to convert the Contrast tool into a module some time after 2.1 is released. Neither of us knows how to do that yet but that will hopefully resolve some “multi-project” issues for this tool. In other words, it’s likely to be pretty much a re-write, so not much point logging a load of P5s (most of which will be resolved with the already written first patch).
Probably our custom representation of infinity so, “-Infinity”. And white space would show the same word.
I don’t see we can stop people trying to use Contrast as a measuring tool rather than something meant to analyze background/foreground contrast. And if people select white space or silence between audio I think it should not ignore that whitespace or silence, so I disagree with Martyn. Selecting a region including “no useful audio” may mean the user is making bad selections.
Perhaps Contrast could give a smarter message if there is a “nonsensical” pass result.
As long as you are aware of and will incorporate fixes for unlisted P5’s they can stop off Bugzilla.
Just for giggles, what happens to a Contrast value if an RMS meter reading is “lumpy?” That is, it hovers around, say -65, but because it’s measuring live audio, wanders up to -61 and down to -69.
What it says on the tin.
It counts the number of samples, multiplies each sample value by itself (square of the sample value), adds up all of the “squared” sample values and divides the sum by the number of sample (mean of the squared values), then takes the square root of the answer.