Fix WAV resources ignoring the AudioServer's 'global_rate_scale' value

(cherry picked from commit 04ebe4e7a4)
This commit is contained in:
Michael Alexsander 2020-11-04 17:03:12 -03:00 committed by Rémi Verschelde
parent 00c631b13c
commit fc1f5e149f
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -254,7 +254,8 @@ void AudioStreamPlaybackSample::mix(AudioFrame *p_buffer, float p_rate_scale, in
sign = -1;
}
float base_rate = AudioServer::get_singleton()->get_mix_rate();
float global_rate_scale = AudioServer::get_singleton()->get_global_rate_scale();
float base_rate = AudioServer::get_singleton()->get_mix_rate() * global_rate_scale;
float srate = base->mix_rate;
srate *= p_rate_scale;
float fincrement = srate / base_rate;