NPC lip movement differs from original engine
NPC lip movement differs from the original engine. I haven't looked into it in depth but I noticed the issue with the guard who walks you through the ship in the opening.
Attached photos are about at the point where the guard's mouth is at its widest. The difference may not be as noticeable with other NPCs, like the dark elf in the very beginning.
#4 Updated by Chris Robinson 3 months ago
Might also want to look in [url=https://github.com/OpenMW/openmw/blob/master/apps/openmw/mwsound/loudness.cpp#L12]this function[/url] which calculates the "loudness values" used to open the mouth. We currently take the root mean square of a chunk of audio samples to produce the loudness value, but this may not be the optimal way of calculating how open the mouth should be.
#6 Updated by Chris Robinson about 2 months ago
Can you explain the output of the function you pointed to? I'm not sure how the range of [-1, 1] translates to "loudness". Is -1 silent, 0 medium, and 1 loud? And is it linear or logarithmic (like the decibel scale)?
The function results in linear loudness values between 0 and 1. 0 is silent (mouth completely closed) and 1 is full volume (mouth completely open). It's the root mean square (RMS) of a number of samples. Given an array of input samples that range from -1 to +1, it's calculated as:
rms = sqrt((samples*samples + samples*samples + ... + samples[n-1]*samples[n-1]) / n);
This is the standard way to get the perceptual loudness of a series of audio samples. Every 'n' samples produces another rms value, and these series of values are used as the loudness over time (at a rate of 20 loudness values per second, currently).