[mythtv-users] Commercial detection with silence - silence.cpp
Jean-Yves Avenard
jyavenard at gmail.com
Sun Aug 11 00:34:27 UTC 2013
On Sunday, 11 August 2013, HP-mini wrote:
>
> for (unsigned i = 0; i < frameSamples; i++)
> avgabs = (avgabs / (i+1)) * i + abs(samples[i]) / (i+1);
>
>
This method will only work if using floats... With int you'll accumulate
errors as you go.
You're better off using the previous method (add them all and only divide
outside the loop.
All types must be changed so you don't compare signed vs unsigned
Note that it is my plan to add in 0.28 silence commercial detection
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130811/be1cb8f3/attachment.html>
More information about the mythtv-users
mailing list