SoundService.DopplerScale is a built in value that determines how sound warps when its source is moving. The dev wiki page mentions roblox uses something called FMOD for sound, and I have no idea how the math works for that other than that FMOD says that 0 is no doppler, 1 is “natural” doppler and 5 is an exaggerated doppler. Roblox’s scale goes beyond 5, though.
Your best bet is probably changing this value until you find something that works for you
Are you talking about Effects? If so I am the right person.
An easy way to get higher pitch is simply by raising the frequency of a sound.
You can do this in several ways.
Increase the speed of playback
Use PitchShift to change the pitch(recommended)
Use a part that is moving to create a doppler effect.
If you want to look more into PitchShift you can view it here.
One last thing. If your sound is not high enough you can add multiple PitchShiftEffects to multiply the sound So if you want lets say x64 high pitch sound simply add 8 PitchShift SFX to a sound and set them all to 2 octave
I don’t think OP wants to recreate the Doppler effect, which is just a phenomenon that describes an increase in the pitch of a sound from a stand-still observer (doesn’t necessarily have to be stationary) as the vehicle approaches them, and a decrease in the pitch as it is moving away from the observer
It’s simply just increasing the pitch of the sound based on the speed the driver is moving at, which can just be done by a linear equation:
The Doppler Effect is already a part of Roblox Studio. You do not need to recreate it.
However, if you still want to recreate it simply use the Velocity to find out the difference in magnitude from the players camera to the part that is moving. Then increase the PitchShiftSoundEffect.Octave by the number that you found out.
Given that an increase in the velocity will result in an increase in the engine’s pitch at the same rate and the same can be said for a decrease, it can be said that the two quantities, the vehicle’s velocity and the engine’s pitch are proportional to each other.
A general formula can be derived for two quantities that are proportional: p = k * p
v is the vehicle’s velocity
p is the engine’s pitch
k is a constant, that is referred to as the constant of proportionality
Changing a sound’s speed will affect its pitch proportionally, given that the wavelength of the sound wave is constant, so we can derive an equation: v = λ * f
v is the sound’s velocity
λ (Lowercase Greek letter “lambda”) is the sound’s wavelength, being the constant of proportionality here
f is the sound’s frequency (which represents its pitch)
Another example of two quantities being proportional to each other
These are the physics formulas for the doppler effect. Basically this states that:
the pitch of audio is some constant multiplied by a velocity (faster = higher pitch, slower = lower)
The speed of a sound is proportional to its wavelength and its frequency. We hear frequency as pitch and wavelength remains (mostly) constant, so, again, the more speed in a sound wave, the higher the pitch
The first equation is more useful here because roblox doesn’t show you wavelength or pitch, so you will want to make a script that relates velocity and pitch, like Rare_tendo said. The formula sound.PlaybackSpeed = Multiplier * Vehicle.Velocity.Magnitude is literally pitch = speed * k, which is exactly how the real life doppler effect occurs.
Back in my previous message I mentioned that you can use SoundService.DopplerScale to do the same thing without scripting, and this probably uses this same formula, but I don’t know what k is when you do that which is why I said to experiment if you want to go down that path