Play only a specific part of a sound

Hello, everyone! As a developer it’s currently pretty impossible to change the time length of a sound. Many developers found a part of a sound interesting, but they can’t just adjust the length without writing special handling code.


My suggestion:

My suggestion is to add 2 more properties for sounds: they could be called SoundStart and SoundEnd. The users will just type the time the sound should start and end there. For example, there’s a 3 minute sound, but I liked only the piece of the sound that starts at the 30 seconds. In SoundStart I’ll type 0:30 and I’ll keep SoundEnd set to 3:00.


How it will help the others:

If Roblox was able to address this issue, my developing experience would be improved because I would now be able to select a certain piece of a sound quickly.


Thanks for reading my post and have a nice day! Please, like it if you agree!

44 Likes

For anyone finding this off google searches, this has been implemented.

Use playback regions. You can enable them through the properties window with the sound selected. A new category called “Regions” should appear in the properties window and there are 2 properties that both take in NumberRange values.

LoopRegion will play the audio in that range after the sound has been looped; it only applies when you have the looped property set to true. PlaybackRegion is the overall range on where the sound starts playing and where it ends and overrides the LoopRegion if the min of LoopRegion is less than the min of PlaybackRegion. Once the TimePosition property reaches the max value of that region, the sound will set the TimePosition to the min value of the loop region if looped is set to true or to the min value of the PlaybackRegion. Heres an example on how you can use PlaybackRegions.

local loopRegion = NumberRange.new(10, 25) – Starts at the 10 second mark and ends on the 25 second mark once looped.
local playbackRegion = NumberRange.new(5, 25) – Starts at the 5 second mark once the sound starts playing and stops at 25 seconds if the looped property is false.

local newSound = Instance.new(“Sound”)
newSound.SoundId = “rbxassetid://[Your Sound Id]”
newSound.Looped = true – Can be used for loop regions.
newSound.PlaybackRegionsEnabled = true – Be sure to enable this property or the regions won’t be able to interact with the sound.
newSound.LoopRegion = loopRegion
newSound.PlaybackRegion = playbackRegion
newSound.Parent = workspace

newSound:Play()

Credit to Profile - lucasawil - Developer Forum | Roblox for the answer.

1 Like