How to Play Audio Backwards in Unity (How to Reverse an Audio Clip)
Max O'Didily
How to Play Audio Backwards in Unity (How to Reverse an Audio Clip)
Greetings, in this Unity tutorial we shall be looking at how to play an audio clip backwards in Unity. To play audio backwards in Unity, we can tell the audio source to play audio clips backwards by setting the pitch to be -1f.
Then we need to tell the audio source to start playing the clip from the last sample (the end of the audio file), so when we start playing audio, we are starting from the end and can work backwards.
This Unity tutorial is great if you want to play music backwards or want to play a sound effect backwards.
This method for playing audio backwards in Unity will loop audio backwards too.
So to summarise:
You can set the pitch of an AudioSource to a negative value to play it backwards! You have to set the AudioSource.timeSamples to AudioSource.clip.samples -1 in order to play it.
This tutorial on how to reverse an audio clip in Unity won't work for WebGL games.
Thanks for watching this Unity tutorial on how to play audio in reverse.
If this tutorial on how to use the Audio Source pitch to play sound backwards in Unity was useful, then be sure to subscribe for more Unity tutorials.
How to Play Audio Backwards in Unity (How to Reverse an Audio Clip) ... https://www.youtube.com/watch?v=g6Z4rtQpqAY
8899409 Bytes