Sounds are sputtery and broken

  • I have a project that I wanted to start working on again but the sounds in the place are now broken, and making terrible sputtering noises when playing at the same time. I do not know when the bug started happening, but I notice it now.

  • I had last updated the place a 6 months ago and do not recall this bug happening.

  • I have sounds in a place along a small river that would play water sounds. If more than one sound is playing at a time, then they all sound like sputtery garbage.

  • This bug happens every time. Tested multiple times in studio and StartServer-StartPlayer.

  • Attached is a repro place file with two sounds inside parts. When you play the place, and toggle the “Playing” property of both sounds, the noise become garbage.

Glitchy Sounds.rbxl (12.9 KB)

11 Likes

This was happening in a game I’m working on too. I fixed it by wrapping :Play() in spawn(), but I’m not sure why that works and it makes a tiny delay before the sound starts playing.

1 Like

this has been reported many times over the past several months
I think they acknowledged it was a problem a few months ago but I don’t believe there has been any word on a fix
it is extremely annoying in sound heavy games

4 Likes

Yes this has the same root issue as a few other sound reports. Latest attempt at fixing this issue (… without breaking other parts of sound playback :sweat_smile:) will be rolling out to desktops this week.

4 Likes

The experiment last week was a partial failure (increase in crash rate), we are investigating another fix

1 Like

I also wanted to point out that .TimePosition isn’t working as expected.

My code sets the TimePosition of an audio to 20 seconds, then plays it.

Half the time it works, half the time it doesn’t work. When it doesn’t work, the audio will play from the beginning, but the TimePosition property reads as it being 20 seconds.

I want to have 2 speakers playing music, but the distance in between them is a jittery mess >:(

I don’t know if this is related, but sounds no longer overlap each other and they’re cut off if you have an automatic weapon, or any other object that plays a sound a lot in a single second.

A simple work around is to create a sound object when the event fires, but the problem with that is it might cause a performance hit due to sounds being created and then instantly destroyed.

Duplicate of this bug report back in December

Hi Reshiram110, do you have an .rbxl file that demonstrates the problem with TimePosition? Or can you give a detailed recipe that reliably reproduces it? I’m looking into fixing it, but have not been able to reproduce it yet.

Hi, here’s the repo file:
AudioPlayer_Bug_Repo.rbxl (17.3 KB)

Here’s an explanation of the modules and localscript:
game.ReplicatedFirst.Audio : This localscript contains a snippet from my loading screen code. This is part of the code in question that is affected by the bug.

game.ReplicatedStorage.Utils.AssetUtils : Just a util module that makes it easier to preload assets by reducing the amount of code that I need to type when I need to preload an asset.

game.ReplicatedStorage.Classes.AudioPlayer : The audio player class with the code that (potentially?) causes the bug.

NOTE:
I’ve noticed that the bug never occurs when the localscript is ran anywhere else other than game.ReplicatedFirst. The bug ONLY occurs in game.ReplicatedFirst.

STEPS TO REPRODUCE BUG:
Just re-run play solo (or just keep rejoining a local server if you want) until the audio in the game doesn’t start from the beginning. Note how the time position shows as being at the correct time, but the audio itself is not at the correct time. Now, move the Audio localscript from ReplicatedFirst to StarterPlayerScripts. Notice how the bug never occurs when trying to reproduce it?

Thanks Reshiram110!

1 Like

Reshiram110, I have not been able to reproduce the problem yet even with your .rbxl file.
I tried both “Test/Play” and “Test/Start” in Studio multiple times. In order to get the game to run properly with “Test/Start” I had to add the line
local utils = game.ReplicatedStorage:waitForChild(“Utils”)
to the beginning of the Audio script.
I suspect that whatever is happening is related in a delicate way to load timing and I am seeing different timing at my network location.

O.k., I can reproduce it when running off of a real server. Thanks, A reproducible case is a huge help!

1 Like

I need to confirm, but what I think is happening is this: the sound is played without checking to see if it is loaded yet. Before the sound is loaded, the length of the sound is unknown, so TimeLength is 0. If the sound is played before the load completes, then it will either finish playing or will loop immediately. Once it loops, the TimePosition is reset to 0 from whatever you set it to, and it stays there while looping. Then when the sound finishes loading playback will continue from TimePosition 0 instead of where it was supposed to. Since the amount of time it takes to load the sound varies, sometimes the sound will load fast and playback will be correct and sometimes the sound will load too slowly, playback starts too early, and the playback is wrong. A workaround is to wait and confirm that the sound is loaded before starting playback. Running from a real server, I consistently get wrong playback with the script as it is, but consistently get right playback if I insert a 1 second wait after setting the SoundId. 1s is of course overkill, the right thing to do would be a loop checking isLoaded with a small wait, or do something using the Loaded event

2 Likes

Thanks, I’ll implement this in my code and let you know if it works! :slight_smile:

1 Like

2 posts were merged out for being off-topic.

Despite the fact, 3 years later, this issue still occurs, so clearly not fixed.
Although this isn’t a common issue now, it has just happened to me after merely touching the Max and min rolloff distances, and nothing I do, including changing those rolloffs back to their original or new values and adding a wait and :play() into the script (sounds are already playing), will fix it.
This happened today, I was scripting a basic script to modify sounds that loops in a while loop to change the pitch based on a changing value (in this case, the velocity magnitude).
No other sounds have broken, except these two specific sounds. I have other instances of these sound ids and those work fine, they both have the same grandparent (parent of a parent) which is a model. Why is this happening? Sometimes the sonuds splutter, sometimes they just never play. Its a bit random and its super frustrating.

Good morning BritishTrainspotter; could you share the script that you are experiencing this problem with, or a .rbxl that reproduces the issue?