Pausing/Playing sounds

I’ve been having an issue where when pausing a sound and playing it again, it restarts to the beginning.

This seems to only happen when it’s a server script trying to manipulate a sound inside the Player. Actually it has all sorts of troubles.

The script doesn’t seem to be able to read TimePosition accurately, as it always returns 0.
It also can’t set TimePosition manually.
Resume() doesn’t even work
Pause() works but when trying to resume with the Play() method it just restarts the sound.

Just thought it was worth looking into. There might be a better way but it seems like this way shouldn’t just partly work.

1 Like

That’s because sounds are local and there isn’t any sort of audio service goodness loaded onto servers. You need to pause and play it from the client if you want it to work correctly. TimeLength and pretty much anything besides :Play() and :Stop() do not function as expected unless run clientside. In fact, sounds don’t even work as expected with FilteringEnabled. Playing and stopping sounds from the client is not filtered – if the sound exists on other clients as well when it’s played, it will be played for those clients as well, ignoring FE.

So ultimately what you should be requesting is that ROBLOX start accounting for sounds on their servers, but imo that seems pretty unnecessary considering you should be handling sounds client-side anyway. Playing sounds server-side is as bad of practice as non-FE games are.

1 Like

Fair enough, thanks for the response :slight_smile: