diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index e2a01f7230..0a9b56b33d 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -99,7 +99,7 @@ void HeadAnimationTime::update(float dt) { mValue = mTalkStart + (mTalkStop - mTalkStart) * - std::min(1.f, MWBase::Environment::get().getSoundManager()->getSaySoundLoudness(mReference)*4); // Rescale a bit (most voices are not very loud) + std::min(1.f, MWBase::Environment::get().getSoundManager()->getSaySoundLoudness(mReference)*2); // Rescale a bit (most voices are not very loud) } } diff --git a/apps/openmw/mwsound/loudness.cpp b/apps/openmw/mwsound/loudness.cpp index 88c706a91f..ebe3bf1ec5 100644 --- a/apps/openmw/mwsound/loudness.cpp +++ b/apps/openmw/mwsound/loudness.cpp @@ -25,16 +25,16 @@ namespace MWSound // get sample on a scale from -1 to 1 float value = 0; if (type == SampleType_UInt8) - value = data[sample*advance]/128.f; + value = ((char)(data[sample*advance]^0x80))/128.f; else if (type == SampleType_Int16) { value = *reinterpret_cast(&data[sample*advance]); - value /= float(std::numeric_limits().max()); + value /= float(std::numeric_limits().max()); } else if (type == SampleType_Float32) { value = *reinterpret_cast(&data[sample*advance]); - value /= std::numeric_limits().max(); + value = std::max(-1.f, std::min(1.f, value)); // Float samples *should* be scaled to [-1,1] already. } sum += value*value;