summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-10-07 21:04:48 -0400
committer Vas Crabb <cuavas@users.noreply.github.com>2020-10-10 04:01:50 +1100
commitb7e870a3bf8f78a4950db268f957837218de0b2f (patch)
tree6951cbab4d4ab827f025f935f4359ebcf5044949
parent466b84187a70e7f1daf87fa115ffb8f48bf9e80f (diff)
spkrdev: Fix sample volume averaging
-rw-r--r--src/devices/sound/spkrdev.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/sound/spkrdev.cpp b/src/devices/sound/spkrdev.cpp
index ec1ad169196..184a628fe73 100644
--- a/src/devices/sound/spkrdev.cpp
+++ b/src/devices/sound/spkrdev.cpp
@@ -401,7 +401,7 @@ double speaker_sound_device::get_filtered_volume()
{
if (i >= FILTER_LENGTH) i = 0;
filtered_volume += m_composed_volume[i] * m_ampl[c];
- ampsum += m_ampl[c];
+ ampsum += std::abs(m_ampl[c]);
}
filtered_volume /= ampsum;