Sound updating in sync with server

Hello! I am currently writing a Doppler effect runner which is working very well. However, there is some artifacting in the sound.

Heres what it sounds like without artifacting:

And heres what it sounds like with the artifacting, you can hear it dip

Currently, the way it is updated to get it smooth is by listening for when the server changes playback speed, and update it by the calculate doppler value:


for _, sound: AudioPlayer in script.Parent:GetDescendants() do
	if not sound:IsA("AudioPlayer") then continue end	
	
	local wasChanged = false
	sound:GetPropertyChangedSignal("PlaybackSpeed"):Connect(function()
		if wasChanged then wasChanged = false return end
		sound.PlaybackSpeed = sound.PlaybackSpeed * script.Parent.DopplerValue.Value
		wasChanged = true
	end)
end

This works, but obviously theres still some artifacting and I think it may be related to the code here.

Bumping this, the sounds update on the sever at 30 Hz (1/30th) step

I’ve noticed changing the playback speed or position of an audio constantly causes it cut out for a moment.

Anyways, Roblox has a built in Doppler effect already.

The problem with their built in doppler effect is, well, it does not work good at all. The sound ends up too distorted to make it sound good. My implementation properly implements this feature, I’m just trying to figure out if the server is desyncing and causing the pitch to come out unmodified.