Skip to content

Commit 7e4f6bd

Browse files
committed
Merge pull request #104090 from JulianHeuser/AudioEffectPitchShift_fix
Fix AudioEffectPitchShift issues when `pitch_scale` is set to 1
2 parents eabd877 + f7bb2c8 commit 7e4f6bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

servers/audio/effects/audio_effect_pitch_shift.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ void SMBPitchShift::smbFft(float *fftBuffer, long fftFrameSize, long sign)
288288
void AudioEffectPitchShiftInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
289289
// Avoid distortion by skipping processing if pitch_scale is 1.0.
290290
if (Math::is_equal_approx(base->pitch_scale, 1.0f)) {
291+
for (int i = 0; i < p_frame_count; i++) {
292+
p_dst_frames[i] = p_src_frames[i];
293+
}
291294
return;
292295
}
293296

0 commit comments

Comments
 (0)