You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calculating the gated mean of audio that is pure silence, it appears the power result (and also the result of loudness_lkfs()) is NaN. In this case, I'd expect a result like -infinity.
It's unclear to me what the correct behaviour is in this case - a low power value might be sufficient, but as at this is likely going to be used to normalize audio, maybe the gated mean should return an enumeration which can encode that it failed to find any audio above its gating value (which I assume is what happens here).
The text was updated successfully, but these errors were encountered:
The loudness in LKFS is based on the logarithm of the power, so it should be -∞ for 0.0 power. I added a test to confirm this..
gated_mean takes the average power over all blocks that pass the absolute threshold, and then the dynamic threshold. The absolute threshold of -70 LKFS would already result in an empty set, so then the average causes a division by zero.
After thinking about it for a bit, I agree with you, it makes sense to change the return type to Option<Power>, so it can return None when no signal remains after gating.
I was torn between this or returning Power(0.0) but the more I think about it, the more I think that it makes sense semantically for the gating operation to never be able to return a power of 0. So yes, I think this makes sense.
When calculating the gated mean of audio that is pure silence, it appears the power result (and also the result of
loudness_lkfs()
) is NaN.In this case, I'd expect a result like -infinity.It's unclear to me what the correct behaviour is in this case - a low power value might be sufficient, but as at this is likely going to be used to normalize audio, maybe the gated mean should return an enumeration which can encode that it failed to find any audio above its gating value (which I assume is what happens here).
The text was updated successfully, but these errors were encountered: