Sound:Play() does not respect PlaybackRegion.Min if Playing is true

When calling Sound:Play() while Sound.Playing is true, the sound’s PlaybackRegion is ignored if set and resets to 0 instead of PlaybackRegion.Min.
(LoopRegion has no effect on this and the bug still occurs regardless of its value)

Repro

  1. Create a Sound object
  2. Set its PlaybackRegionsEnabled property to true and its PlaybackRegion.Min to any value
  3. Call Sound:Play() on it twice, the second call will reset TimePosition to 0 as Playing is true

Demonstration

image

Both sounds should be identical, however the second call resets TimePosition.

Place file

timePosition.rbxl (54.1 KB)

2 Likes

Hey nothing_1649, thanks for the repro file! I think this is occurring due to a bug in :Play()'s “restart from the last set-time” behavior; it seems to be incorrectly replaying from the last set-time even if PlaybackRegion.Min is bigger.

We’ll look into it, but for the time being, if you add a call to :Stop() immediately before the call to :Play(), does this produce the behavior you’re after?

1 Like

thanks for the response, i just checked and yes calling :Stop() appears to produce the intended behaviour
image

Cool; that should continue to be a valid workaround, but we’ll put in a fix for this so that you don’t need the :Stop()

1 Like

Hi, we pushed out a fix that should address this. Can you see if it works now? Thanks!

1 Like

works perfectly now, thanks for looking into it

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