I thought that I would use
Code:
dB_level = floor(20 * log10((abs(spl0) + abs(spl1))/2));
to convert the average audio amplitude to dB.
I looked in some other JSFX and saw:
Code:
sc=6/log(2); // 8.656
dB_level2 = floor(log((abs(spl0) + abs(spl1))/2)*sc); // dB
What am I getting wrong? If they give the same result, which is more efficient? And why?