I’m setting global time dilation to 0.2 which makes my animated mesh slow down, playing the animation longer. There is also an accompanying sound effect. Since sound cues remain unaffected by the change in time dilation I manually set the pitch multiplier for the audio component to the same value as the time dilation (in this case 0.2). I expected the sound to stay in sync with the animation but that’s not the case: the sfx finishes much earlier.
Why is that?
Is there a way to precisely calculate the optimal pitch multiplier for a given time dilation value?
I would have the time dilation factor stored in a variable, and lerp the pitch factor based on that variable. Depending on how drastic you want the sound’s pitch to change, you’ll have to fine tune it.
I’d start off with a factor of initial pitch to pitch_octave-1, so C4 to C3 etc
It seems that the low end of the pitch multiplier is clamped to around 0.4. So with both time dilation and pitch multiplier set to 0.4 things are in sync. At 0.35 the sound finishes sooner then expected. Also a 0.1 pitch multiplier sounds pretty much the same as 0.4.
Trouble is that I’d need a 4x-5x slowdown. :\
Sadly even if I produce an additional, slowed down version of every single sound it’s still not a solution as I can’t sync the two versions: I couldn’t find a way to get what percentage one sound is at or set where to play a sound from.
Could anyone tell me what I’d need to change in the engine source code to fix this? I searched for “pitchMultipler” but couldn’t find any sort of clamping.
For anyone who might still be interested in this, there are two variables to change in the engine source code to update the clamp values: GlobalMinPitch
/GlobalMaxPitch
in AudioDevice.cpp & GlobalMinPitchScale
/GlobalMaxPitchScale
in AudioSettings.cpp