From 04ebe4e7a4e6746d7ca586c2243580ee12bbd245 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 4 Nov 2020 17:03:12 -0300 Subject: Fix WAV resources ignoring the AudioServer's 'global_rate_scale' value --- scene/resources/audio_stream_sample.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene/resources') diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index f02e7987a9..600a859894 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -261,7 +261,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; -- cgit v1.2.3