How can I make a sound play in reverse?

Hello, what I want to do is take a “charge up” sound and, when other parameters that I won’t list here are met, play that sound in reverse, to create a charge down sound. Problem is, I don’t know how to do that. I did find some old threads on here that talked about using TimePosition but I can’t find out how to actually use that to fix the problem. Any help?

3 Likes

I dont think it’s possible to reverse a sound using scripts. You might have to upload the audio in reverse.

3 Likes

It is kind of possible. I just booted up studio, inserted a song set to looped and playing by default and then inserted this script into the sound object:

while true do
	script.Parent.TimePosition = script.Parent.TimePosition - 0.05
	wait(0.01)
end

I say kind of possible because the song is playing backwards but it sounds very choppy. Maybe try having a fiddle with the numbers and see if you can get it a bit smoother.

2 Likes

That was an Idea I had too, but it won’t work. Each segmant of the audio is still playing foward even though they are arranged in reverse. You would have to get every single bit of data from the audio and rearrange it but thats not possible with scripts.

Unless he dosen’t mind it being choppy.

1 Like

I am aware of that. But I guess that is currently the closest we can get unless somebody figures out some probably very hacky method to somehow do it.

1 Like

It could probably become smoother if you just made the time even shorter (the best would be if you could have 1 frame at a time), but I dont think the wait function can support that

Sound plays faster then frames so you would need to have a really small delay which will not be achievable with using wait(). Anouther idea I have is to use the GetPropertyChangedSignal event on the PlaybackLoudness so it will fire every bit of the audio and hopefully making a smoother reverse.

If sounds player louder then frames, maybe you could try just removing the wait? I’m not familier with sounds since I have never used those before

no delays in an infinite loop will result in a crash.

1 Like

It’s impossible to reverse a sound, but here’s something that you can try:

  1. Add a ReverbSoundEffect (to make the sound smooth)
  2. Subtract from the TimePosition (while playing, and on the client) the amount of seconds between the current and last frame.

Or you can do it the easy way; download the audio yourself (some browser extensions do this), and reverse it with an audio editor. Then reupload to Roblox.

Thats not a bad suggestion, I guess it could merge the segments to create less of a choppy audio.

3 Likes

Thanks everyone for the replies but I ended up just reversing the sound using some site on the internet and then uploading that sound and using it, but again, thanks!

2 Likes