Creating Super Short Audio Loops

I am writing this article because there is insufficient information in YPT300’s article
For reference, I am using Audacity for audio editing.

To get straight to the point, Roblox Studio’s audio loading system may result in very slight loss or addition of silence.
This is because when the system loads your sound file, it rounds your sound to three decimal places.

If you load an audio file in Roblox Studio that is 0.00361 seconds long, the audio will be 0.004 seconds long.
This is the same for rounding down. If you load an audio file that is 0.01136 seconds long, it will load in 0.011 seconds.

This is a serious problem! What if the part around 0.00036 seconds that was rounded down and disappeared was the most important part?
In some cases, this audio file may exist silently in Roblox Studio!


You might ask: That’s only a difference of 0.001 seconds at most! There won’t be much of a problem.

So I prepared a video that will answer your questions.


This video shows 0.00383 seconds of audio and 0.004 seconds of audio by adding silence at the end of 0.00383 seconds of audio.
As you can see in the video, rounding up also has serious consequences.
In fact, the same result appears in Roblox Studio.


The introduction was too long. Now I will explain how to solve this problem.
What if we can’t use a file with the correct audio length?

Fortunately, Roblox Studio’s AudioPlayer instance has properties called LoopRegion and PlayBackRegion.

We can adjust the loop of the audio by modifying these two properties.

Now, to prevent audio loss due to rounding down, create an audio file that is slightly longer than desired and then adjust the PlaybackRegion property to determine the end of the audio.

For example, create and load an audio file that is intentionally 0.004 seconds long and set the PlaybackRegion property to (0, 0.00383).

This way, you can prevent audio loss due to rounding down, cut out unnecessary parts due to rounding up, and use the audio you want!

7 Likes