Sound.PlaybackRegion works by now?

Hi! Probably a silly question that has been documented a few times in DevForum a couple years ago, but I need to know whats the status of Sound.PlaybackRegion. Anyone has been successful while using it? or Im just doing it wrong?:

local Sound = aSound:Clone()
Sound.PlaybackRegionsEnabled = true
Sound.PlaybackRegion = NumberRange.new(x, y)
Sound.Parent = somewhere
Sound:Play()

Post1
Post2
Post3

Thanks for your time!

Well I found that no matter if a Sound Instance has already its PlaybackRegion parameters to a specific seconds (min-max) (even from studio or by changing them from script), it will always ignore the min value, and it will start from 0, but, it will stop when reaching the max value properly.

Meaning the only way I found to make it play only within the “range/region” time is by setting its TimePosition to the desired starting time… which breaks totally the idea of having PlaybackRegion feature, because TimePosition seriously brakes the sync/timing/scheduleTask and its impossible to keep perfect timing on multiple audios that should be played at the very same time (under certain circumstances).

	local newSound = aSound:Clone()
	newSound.Parent = somewhere
	newSound.PlaybackRegion = NumberRange.new(timePos, timePos+3)
	newSound.TimePosition = timePos
	newSound:Play() -- newSound:Resume() -- tried too

I understand this feature was released under certain warnings, should I forget about this and explore previous approaches I’ve been working on?.

This feature was a pretty good idea for advanced musical games… (specially when not having room/rigths to upload hundreds of audios to have granular handling of notes/audios. And using a big audio file made with lots of notes/fx and just change its TimePosition or PlaybackRegion to play a note would be pretty useful to build playable instruments)

1 Like

After some testing, I believe PlaybackRegion becomes unreliable when the sound is played before it is loaded.

Try adding these lines before playing:

if not sound.IsLoaded then
	sound.Loaded:Wait()
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.