Skip to content

Commit 102c191

Browse files
committed
AudioLoudness: Adjust the value to be closer to Scratch
1 parent e30d0c3 commit 102c191

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/audio/internal/audioloudness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static void data_callback(ma_device *pDevice, void *pOutput, const void *pInput,
2222

2323
for (ma_uint32 i = 0; i < frameCount; i++) {
2424
float value = pMicDataArray[i];
25-
sum += value * value;
25+
sum += std::pow(value, 2) / 20.0f; // TODO: Convert the value properly (it's different than in JS)
2626
}
2727

2828
float rms = std::sqrt(sum / static_cast<float>(frameCount));

0 commit comments

Comments
 (0)