How would I speed up a sound without changing the pitch and do the same with slowing down?

The title says it all but I wanna get some more things clear first.

I only want a simple math equation which can take the speed of a sound and adjust the pitch using a pitch-shift sound effect to make the pitch normal.

I want to be able to update the sound to be able to constantly change speed but the pitch stays the same.

I know you can set the speed to 0.5 and set the octave in the pitch-shift effect to 2, but I want more options than just that.

I tried the only equation I can think of which is the difference between 1 and the speed of the sound * 2 for the octave, but that doesn’t work well.

There is no such thing as “speed of sound”. Sound is a series of vibrations in the air. Think about a sine wave. By changing the frequency of the wave, you can change the pitch of the sound. If you change the amplitude of the wave, you change the volume of the sound. If you do both at the same time, you can change the pitch and amplitude of the sound simultaneously.
To change the frequency of the wave, you have to change the number of cycles per second. If you double the number of cycles, the pitch will be an octave higher. If you halve the frequency, the pitch will be an octave lower.

This isn’t what he is talking about, not does it relate to what he is asking for, It can also be considered off topic.

1 Like

I don’t know whether to be more concerned that you replied so fast where it didn’t even show you replying, or how this is not helpful at all since the only useful information I already know and is common knowledge if you have ever messed with sounds before. Nevermind thought that was a bot it probably isn’t, do those even exist on the devforum?

1 Like

So I offer my time and help and this is what I get, my how this community has fallen.

He is asking for changing the PlaybackSpeed along with its Pitch to match as if it were normal speed, Real Life isn’t relevant here, and I’m not sure why it is important for this case.

1 Like

That was probably the rudest thing I have seen on the devforum and I was the one who said it, it’s not really the community it’s just me. Either way aside from this do you have anything helpful?

In order to pitch-shift a sound in a way that maintains a consistent pitch as the speed of the sound changes, you can use the following equation:

pitch_shift = (target_speed / original_speed) * original_pitch

1 Like

Thanks, I will try this out, sorry for being rude. I was pretty sure you were a bot because I didn’t even see your thing pop up in the replies section and that message was longer than average replies I see. I guess it must have bugged?

Whatever you say bro. whatever you say

Only if you saw what I did, or I guess didn’t see.

What would I set the original speed & pitch as? Both of them if they are supposed to be intended pitch would just be 1 since that is the default pitch of the sound.

I dont know I am not your daddy

??? what does parenting have to do with any of this

You started the hsotilities first my friend

And I have apologized for them

You won the battle but i’ll win the war

this is devforum not twitter, if you do not have anything helpful, stop replying to this topic

1 Like

you have put me on a villain arc

Anyway to get back On Topic,
There isn’t really much you can do with Sounds, What you have is the correct way and its just the Limitations of the Roblox Sound Engine.

PitchShiftSoundEffect has a limit of between 0.5 - 2 so your options are limited

Basically the equation @xDeltaXen showed is pretty much just the same exact thing you started with, with an extra step:

.9 / 1 * 1 -- if your new Pitch is .9, The Result will be .9, No Changes

0.9 / 1 is 0.9
0.9 x 1 is 0.9

I hope this helps.

1 Like