Sounds keep breaking (?)

For some reason, the sounds in my game keeps breaking (aka not playing at all).
I have joined other games and they have no issues with this, I thought this was a studio issue, but it’s the same in a live server - very annoying…

Does anyone else have any issues with sounds in their game?

It could be the way you’re playing the audio or it could be something else, are any errors appearing about a specific error code when trying to play the audio?

It’s a simple Sound:Play(). The sound is valid and works sometimes apparently, mostly not.

Hmm, when is the audio supposed to play during the game or is just a infinite background audio? You could try setting the Playing property if it’s the latter rather than making a script to play it. If it’s not what you wanted and you said your script is jsut a simple :Play() of a sound, then I’m not sure if it’s a bug or something else

The sound is set up to play whenever you click a button.
Seems like a bug as other games do not have this issue. Maybe the audio is bugged, but other games use that audio as well.

I’m guessing you’re using a localscript? Where is the script located?

StarterGui (PlayerGui) where it should be located.

Then it can’t be the location of the localscript affecting, it probably has to be the way the code is written, but if it’s working sometimes then I’m not sure if it’s a bug on your end or the code wasn’t written correctly or something else

The code works perfectly fine, as I said: it only break sometimes, sadly most of the times.

Hmm, that’s quite odd. When you said they’re working sometimes, did you do anything different to activate it? Maybe you could try to use MouseButton1Down instead of MouseButton1Click if you’re using the latter.

Besides that, I’m completely stumped, it’s probably a bug. Does the script work with other audios or do t hey suffer the same fate?

I always use MouseButton1Click as I see no other reason to use something else.
And yes, all audios break sometimes. It’s never just one.

Does your output say anything about it? If not, can you elaborate on how you are playing the sound?

The output has no yielding / errors on the sound.

As I mentioned above (which you probably didn’t read): I am using a simple Sound:Play().

Hm. In this case I would add a sound object into the workspace with enabled being set to false, then making a script which would trigger an event to set enabled to true on the sound object.

local Sound = game.Workspace.Sound

(Put your if statement here or whatever)

Sound.Enabled = true

wait(how much time the sound takes to finish)

Sound.Enabled = false

Seems like it has been fixed already, it is most likely a rare bug as I have not seen it before.

1 Like